Handling 5xx responses

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

 



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> 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> 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
>>> 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>
PGP Fingerprint 39A4F092 FFA7C746 CC305CB0 69091911 146D10DE



[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