[asterisk-users] PJSIP Weirdness, or just my weirdness?

Steve Murphy murf at parsetree.com
Mon Sep 12 21:13:23 CDT 2016


SOLVED!

Many THANKS to George and Anthony! See at the very end, my comments...



On Thu, Sep 8, 2016 at 5:58 PM, Anthony Joseph Messina <
amessina at messinet.com> wrote:

> On Thursday, September 8, 2016 1:12:36 PM CDT Steve Murphy wrote:
> > Hello!
> >
> > Oh, wise ones, ponder with me over two of the surprises that
> > populate the universe!
> >
> >
> > I have a phone, that I sometimes cannot reach, connected via pjsip.
> > It can call other extensions just fine, it can call out over a
> > trunk to my cell, all is well, but getting a call? Forget it most of the
> > time.
> >
> > Here is all the config relevant to that phone:
> >
> >
> > [murftest12]
> > type=aor
> > qualify_frequency=1992
> > max_contacts=2
> >
> > [murftest12]
> > type=auth
> > auth_type=userpass
> > username=murftest12
> > password=SjU3
> >
> > [transport-udp]
> > type=transport
> > protocol=udp
> > bind=0.0.0.0:57969
> >
> >
> > [murftest12]    ; Cisco SPA514G mac=A4:93:4C:FE:1D:A2
> > type=endpoint
> > auth=murftest12
> > transport=transport-udp
> > aors=murftest12
> > moh_suggest=default
> > force_rport=yes
> > rewrite_contact=yes
> > rtp_symmetric=yes
> > dtmf_mode=rfc4733
> > disallow=all
> > allow=ulaw ; from phonetype
> > allow=g722 ; from phonetype
> > allow=alaw ; from phonetype
> > allow=alaw ; from phonetype (G.729 replaced with alaw)
> > direct_media=no
> > context=phone
> > rtp_timeout=120
> > set_var=__phoneid=12
> > set_var=__contacttypeid=4
> > set_var=__phonelineid=78
> > callerid="Steve Murphy" <101>
> > call_group=2
> > pickup_group=2
> > mailboxes=101 at murftest
> > language=en
> > send_rpid=yes
> > send_pai=yes
> >
> > ​OK, that completes the config (I hope).
> >
> > Now, when I run "pjsip show endpoints, I get:​
> >
> > SFO02-HostedPBXPJSip-Dev03*CLI> pjsip show endpoints
> >
> >  Endpoint:  <Endpoint/CID.....................................>
> > <State.....>  <Channels.>
> >     I/OAuth:  <AuthId/UserName..............
> ..............................
> > ...............>
> >         Aor:  <Aor............................................>
> > <MaxContact>
> >       Contact:  <Aor/ContactUri..........................> <Hash....>
> > <Status> <RTT(ms)..>
> >   Transport:  <TransportId........>  <Type>  <cos>  <tos>
> > <BindAddress..................>
> >    Identify:  <Identify/Endpoint............
> ..............................
> > ...............>
> >         Match:  <ip/cidr.........................>
> >     Channel:  <ChannelId......................................>
> > <State.....>  <Time(sec)>
> >         Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
> >  ===========================================================
> > ==============================
> >
> >  Endpoint:  murftest12/101                                       Not in
> > use    0 of inf
> >      InAuth:  murftest12/murftest12
> >         Aor:  murftest12                                         2
> >       Contact:  murftest12/sip:murftest12 at 67.215.23.186:54 171a08228b
> > Unavail       0.000
> >       Contact:  murftest12/sip:murftest12 at 67.215.23.186:21 d9a15f4e35
> > Avail        50.514
> >   Transport:  transport-udp             udp      0      0  0.0.0.0:57969
> >
> > ​ Note that there are TWO Contact: entries! one Avail, the other
> Unavail...
> > the show endpoints doesn't display all the URL, but the show contacts
> does:
> >
> > ​  Contact:  murftest12/sip:murftest12 at 67.215.23.186:21800  d9a15f4e35
> > Avail        50.514
> >   Contact:  murftest12/sip:murftest12 at 67.215.23.186:54004  171a08228b
> > Unavail       0.000
> >
> > None of my other phones have two contacts listed.... and this phone, a
> > cisco-spa-514, has just one sip account...
> >
> > The trouble is, when I try to call it.... sometimes the INVITE is
> directed
> > to the "Unavail" entry, and the call never completes. The phone doesn't
> > even ring then. Any ideas? I tried to get the "Unavail" entry out... I
> > removed it from the db, I rebooted the phone, restarted asterisk, and it
> is
> > still there.
> >
> > MYSTERY #2:
> >
> > The above cisco-spa, when it calls out over the trunk, all is well,
> > wonderful 2-way audio.
> > But when I do the same operation from my yealink phones, I get my cell
> with
> > one-way audio.
>
> I just resolved a similar issue with a new Yealink phone and PJSIP.  It
> seems
> that Asterisk (depending on many transcoding parameters and types of calls)
> may send out a different codec on leg B than it receives on leg A.  While
> less
> than optimal for the end user, this is allowed by the RFCs.  Yealink
> doesn't
> seem to handle this well.  The firmware referenced in this link fixed the
> issue for me, as least with my T48G and DAHDI/PJSIP calls.
>
> http://forum.yealink.com/forum/showthread.php?tid=8330&pid=39161#pid39161
>
>
> > It's a classic NAT situation: the phone system is in a droplet at digital
> > ocean, but my phones are here at home behind a NAT. I see only 3 NAT
> > related options:
> >
> > force_rport
> > rtp_symmetric
> > rewrite_contact
> >
> > and I set them all to "yes", and they can call each other, but as
> > explained, in
> > dialing out thru a trunk, the yealinks get one-way audio...
> >
> > Any more NAT options?
> >
> > many thanks...
> >
> > murf
>
>
​George's previous message on this thread, plus this one were very helpful
in solving my problems.

I discovered:

1. Mystery #1 was a combination of factors:
   1. The max_contacts=1 and remove_existing=yes did in fact get rid of the
       dual contact problem! But I still could not get an INVITE to my
phone.
   2. The use of qualify_frequency=60 in my aor solved the access problem.
       For some strange reason, my NAT path was shutting down before 120 sec
       for this phone, which is considerably shorter than the other phones,
for
       some rather unobvious reasons.
2. Mystery #2, as it turned out, actually was because of codec choices. The
phones
    I was using were not in the list for firmware upgrades, so I had to
take a different
    approach: actually standardize the codec list for phones and trunks, to
all be the
    same. I did that, and all the 1-way audio problems went away.

Thanks for the help! I hope that others who have the same problems may find
this
message helpful.

murf
​

-- 

Steve Murphy
✉  murf at parsetree dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20160912/5f93cdc9/attachment.html>


More information about the asterisk-users mailing list