Destroy and recreate TCP transport when the connection change

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

 



Thanks for the reply Benny,

That solution works well, overall. But

Sometimes, We get this "error" while sending either the REGISTER with
expires set to 0, or the REGISTER with expires > 0.

16:38:25.666    pjsua_acc.c  .Unable to create/send REGISTER: Object is
busy (PJSIP_EBUSY) [status=171001]

That is a problem, because if it happens with the REGISTER sent over the
new transport and while the app (iOS app) is in background, you need to
wait until another network change and the application is waked up again to
be connected again.

Do you know if we can try something to avoid that PJSIP_EBUSY message?

Thanks again.
Roberto.


On Tue, Apr 17, 2012 at 1:49 PM, Benny Prijono <bennylp at teluu.com> wrote:

> There's a wiki for this: https://trac.pjsip.org/repos/wiki/IPAddressChange
>
> Cheers,
>  Benny
>
> On Mon, Apr 16, 2012 at 9:38 PM, Roberto Perez <robj.perez at gmail.com>wrote:
>
>> Hi,
>>
>> We're building a phone application which is using pjsip as the sip stack.
>>
>> Everytime the connection changes, (i.e. you change from a WiFi connection
>> to a 3G connection), we need to recreate the transport, because of the
>> previous transport is no longer valid.
>>
>> Right now, whenever we detect that connection change, we're "destroying"
>> the full pjsip stack (calling pjsua_destroy()) and proceeding the same as
>> the first start.
>> This works perfectly but pjsua_destroy() blocks the thread (which happens
>> to be the main thread) for a while.
>>
>> We would like to be able to destroy the transport without destroy the
>> full stack of pjsip.
>>
>> To achieve this, we have replaced the pjsua_destroy() with
>> pjsip_transport_shutdown(), but this replacement have some implications:
>>
>> * How can we get the transport reference in this "transport_destroy()"
>> function?.
>> Right now, we are saving the transport in a static variable which is set
>> in the "on_transport_state" callback.
>>
>> * When we call pjsip_init again, this Assert fails:
>> Assertion failed: (pj_list_find_node(&endpt->module_list, mod) == mod),
>> function pjsip_endpt_unregister_module, file ../src/pjsip/sip_endpoint.c,
>> line 229.
>>
>> * As Benny told in this email (
>> http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2008-February/001868.html)
>> the transport is not destroyed at that time.
>> What happens if we try to connect to the same server? Do pjsip try to
>> reuse the "shutdown-but-not-destroyed" transport, which is no longer valid?
>>
>> Which is the best method to create a new transport (and send a new
>> REGISTER message) everytime the connection of the phone changes?
>>
>> Thanks in advance.
>> Roberto.
>>
>> _______________________________________________
>> 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
>>
>>
>
> _______________________________________________
> 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
>
>


-- 
http://zbutton.wordpress.com/
blog sobre programaci?n y tecnolog?a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20120419/829cc6be/attachment.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