Handling 5xx responses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



in the callback function associated to userAgentConfig.cb.on_call_state

use
  pjsua_call_info callInfo;
  pjsua_call_get_info(callIdentifier, &callInfo);

when the callInfo.state is equal to PJSIP_INV_STATE_DISCONNECTED
then callInfo.last_status can be used to check against , for example PJSIP_SC_BUSY_HERE, PJSIP_SC_TEMPORARILY_UNAVAILABLE , etc.....  or whatever you want

hope this helps.

Thanks



On Dec 5, 2011, at 8:31 AM, Alain Totouom wrote:

Hi Paul,

add your custom code to the callback *on_call_state* [pjsua_app.c]
or provide your custom callback method to the stack.
The information you are to single out is in the provided pjsip_event
data structure...

i.e. [e->body.tsx_state.tsx->status_code]

Cheers,
Alain


On 04-Dec-11 19:56, Paul Hazlett wrote:
Ashwin,

I'm using the unmodified pjsua_app.c reference application that is included
with version 1.12 and located in the distro at:
<pjproject-1.12>/pjsip-apps/src/pjsua/pjsua_app.c

I see in the reference application on line 4662 where callbacks are
initialized as:

pjsua_app.c
-------------------
/* Initialize application callbacks */
app_config.cfg.cb.on_call_state = &on_call_state;
app_config.cfg.cb.on_call_media_state = &on_call_media_state;
app_config.cfg.cb.on_incoming_call = &on_incoming_call;
app_config.cfg.cb.on_call_tsx_state = &on_call_tsx_state;
<more initialization follows>

However I see nothing that initializes callbacks for catching 5xx SIP
responses. So this is when I started digging into the pjsip User Agent
Library and found the pjsip_inv_callback structure which defines
on_state_changed - and that seems to me like it would do the trick. I just
don't see how to get that callback wired in to the higher-level pjsua
reference application (which leads me to believe that I'm missing something
trivial).

You mentioned that there are many ways to get notified of 5xx SIP
responses, so how could the pjsua_app.c reference application be modified
to catch such responses?

Many thanks,
Paul

On Sun, Dec 4, 2011 at 10:54 AM, Ashwin Rath <ashwinrath at gmail.com<mailto:ashwinrath at gmail.com>> wrote:

Could you add some code to demonstrate your usage of pjsua ? There are
many ways by which this can be accomplished. Adding the usage example could
make the case more specific.

Cheers

Ashwin

On Sun, Dec 4, 2011 at 12:33 PM, Paul Hazlett <phazlett at gmail.com<mailto:phazlett at gmail.com>> wrote:

Hello.

I'm **very** new to pjsip and I'm trying to figure out how I can handle
5xx SIP responses. Specifically I'm learning pjsip by reading the
documentation and reading the pjsua reference application source code.

The actual use case that I'm trying to resolve is how to get notified of
a 503 SIP response that is generated by the my SIP proxy after sending it
an INVITE.

I see that pjsip_inv_callback has on_state_changed, which looks like what
I need, but how would I add this callback to the pjsua reference
application?

Regards,
Paul

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip at lists.pjsip.org<mailto:pjsip at lists.pjsip.org>
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org



--
Ashwin Kumar Rath


--
                           ""
                         (o)(o)
               _____o00o__(__)__o00o_____
3072D/146D10DE 2011-09-29    Alain Totouom  <totouom at gmx.de<mailto:totouom at gmx.de>>
PGP Fingerprint 39A4F092 FFA7C746 CC305CB0 69091911 146D10DE

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip at lists.pjsip.org<mailto:pjsip at lists.pjsip.org>
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

------
Alejandro Orellana
Savant Systems, LLC
770 Main Street
Osterville, Ma. 02655
(508) 683-2547 (W)
(508) 683-2647 (F)
Alejandro.Orellana at savantav.com<mailto:tim.locascio at savantav.com>

Statement of Confidentiality
The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. The information may also be legally privileged. This transmission is sent in trust, and the sole purpose of delivery to the intended recipient. If you have received this transmission in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail or at 508.683-2500 and delete this message and its attachments, if any.





Statement of Confidentiality
The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. The information may also be legally privileged. This transmission is sent in trust, and the sole purpose of delivery to the intended recipient. If you have received this transmission in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail or at 508.683.2500 and delete this message and its attachments, if any.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20111205/4fe42acf/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux