Codec Problem

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

 



Yes.  I was attempting to use method 1,  restart everything.  When I do the
destroy, init, start I lose codec context( or however codecs are linked
into the chain).  This was unexpected.  I have had some dialog with Apple
and the main comment was the way in which socket streams were not used
properly.  That is,  once the socket pair is created and set as VoIP
sockets(I am using TCP via a proxy to asterisk),  the socket should be made
into a runloop source and bound to a run loop.  In that way,  a
backgrounded (background-suspended state) app will get an event
notification when reachability changes are detected.  PJSIP only uses the
stream construct to mark the signaling socket as VoIP.

I would very much like to use the first method,  if it can be done
reliably.  If I can solve the problem of lost codecs when this method is
used I think my major difficulty will be solved.  I have objects in place
that subscribe to reachability changes and can trigger a reinitialization
of PJSIP.  Again,  the scenario is this:

On first run,  initialize PJSIP.  Everything is fine.
On interface change notification,  tear down PJSIP via pjsua_destroy().
 Then invoke the same initialization routine again.  On this second
construction,  the codec is unavailable so when an INVITE packet arrives I
get the following error:

Warning: 399 iPhone-iOS-5 "No suitable codec for remote offer
(PJMEDIA_SDPNEG_NOANSCODEC)"

If anyone has cracked this problem or has any insights in reloading the
previously loaded codecs I'd be grateful for some advice.

In the worst case,  the socket binding logic in active socket.c and the
routines calling into it would have to be wrestled into compliance with
Apple's asynchronous streams/runloop mechanisms.  This may ultimately be
necessary but it is extremely unattractive as I prefer to treat the
entirety of PJSIP as a black or gray box,  neither injecting application
logic into PJSIP nor having PJSIP low-level management intrude on
application logic.

All hints are welcome.

Thanks All.

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
> (PJMEDIA_SDPNEG_NOANSCODEC)"
>
>  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/cb00992b/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