[pjsip] Codec Problem

Tom Merriewether tmerriewether at star2star.com
Wed Jun 13 12:53:05 EDT 2012

I'm attempting to implement the reachability code provided in the patch.

    if(NULL != theTransport){

        [self registerThread];

        [qLogger logWithFormat:@"%@ Shutting down transport",COMPONENT_NAME



        //crashes pjsua_acc_set_registration(dynamic_account_id, PJ_FALSE);

In every callback I see the account ID = 0.  In all cases the id is 0 for
dynamic_account_id is 0.  However the commented-out call always crashes.
 What is the approved way to get the account ID?  I have only a single

BTW,  the implementation so far seems to work some of the time.  Sometimes
it crashes with assert errors in the library.  I call the above code when I
detect a reachability change.  (Pretty much the same as the patch).

On Tue, Jun 12, 2012 at 6:06 PM, Samuel Vinson <samuelv at laposte.net> wrote:

>  Did you look this: https://trac.pjsip.org/repos/wiki/IPAddressChange
> Samuel
> Le 12/06/12 22:42, Tom Merriewether a écrit :
> I'm implementing a VoIP app on the iPhone and I have a problem with the
> teardown and restart of the pjsip library.  Specifically,  when I detect
> that the user has no network connectivity I want to halt the actions of
> pjsip SIP send/receive until I detect that a useable network is available.
>  Then I want to restart the SIP send/receive so the the SIP sockets will
> bind to the new interface,  say a transition from Wi-Fi to 3G.  I use
> pjsua_destroy to tear things down.  I use the same function to bring the
> library back up again.  The first time I bring the library up everything
> works.  Subsequent loads bring the library up but on receiving an INVITE,
>  I get the error:
>  Warning: 399 iPhone-iOS-5 "No suitable codec for remote offer
>  It looks like pjsua_destroy deletes/stops/kills the media subsystem.
>  Nothing in my code explicitly loads or unloads codecs so I'm guessing its
> a side effect.
>  Question:  How do I start/stop pjsip so that I can quiesce SIP traffic
> when no network interfaces are available and then bring it back up when an
> interface is available .. and do this frequently,  reliably,  and cleanly?
>  I'm doing all this because, as far as I can tell,  the library does not do
> reachability probes and rebind sockets to the appropriate interface.
>  According to Apple,  CFSocketStreams can pass these events to a callback,
>  but other than mark a TCP socket as VOIP,  the library appears to ignore
> the streams entirely.
>  I know this is a lot,  what I'm really doing is trying to get around the
> fact that the iPhone-specific code in the library does not handle
> reachability or stream events.
>  TIA
>  T.M.
>  --
> Thomas Merriewether
> Star2Star Communications
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
> pjsip mailing listpjsip at lists.pjsip.orghttp://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

Thomas Merriewether
Star2Star Communications
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20120613/cd48f1a6/attachment.html>

More information about the pjsip mailing list