[Home]

Summary:ASTERISK-23539: Crash when attempting to dial from a PJSIP endpoint
Reporter:Dan Cropp (daninmadison)Labels:
Date Opened:2014-03-26 10:10:25Date Closed:2014-05-01 09:27:15
Priority:CriticalRegression?
Status:Closed/CompleteComponents:Channels/chan_pjsip
Versions:12.1.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Debian GNU/Linux 7.4 (wheezy)Attachments:( 0) backtrace.txt
( 1) configs.txt
( 2) debug.txt
Description:I am trying to make PJSIP work with my Cisco SPA504G phone.  I have no problems making it work with the chan_sip driver.

When I configure my phone, it indicates the contact was added
-- Added contact 'sip:7001@192.168.9.142:5063' to AOR '7001' with expiration of 3600 seconds

Phone shows green light for the line.

I then attempt to dial extension 1 and Asterisk crashes.  I’m not seeing anything in the messages log.

I’m sure I’m doing something wrong, just not sure where to look or how to track down the problem.
Can anyone offer some hints?

[edit by Rusty - removed inline configs as per issue guidelines]
[edit by Rusty - removed inline debug as per issue guidelines]
Comments:By: Dan Cropp (daninmadison) 2014-03-26 10:12:33.707-0500

This is the backtrace for the crash.

By: Rusty Newton (rnewton) 2014-04-03 18:59:45.670-0500

attaching reporters debug, moved from the description field.

By: Rusty Newton (rnewton) 2014-04-03 19:00:49.636-0500

attaching reports config info in configs.txt

By: Rusty Newton (rnewton) 2014-04-03 19:02:11.304-0500

I can make very similar calls with a chan_pjsip endpoint right now and I don't get a crash. Can you reproduce it every time? Also can you reproduce it with any phone, say a softphone like zoiper or jitsi?

By: Dan Cropp (daninmadison) 2014-04-04 09:36:31.913-0500

Yes, it crashes each time I try to place a call.

This morning, I set it up again and configured a 7001 endpoint as before.  (see configs)
Added a 7002 endpoint.  Setup my PhonerLite application for this.

Tried dialing 1 from both phones.  Each time it crashed.

Tried to setup Zoiper from my Android Zoiper app, but having trouble with the settings.  
(I use Android Zoiper app to give demos of Asterisk with WebRTC.  Allows me to quickly two endpoints for the demos)

Downloading Zoiper Windows app and will give it a try.

By: Dan Cropp (daninmadison) 2014-04-04 09:55:43.771-0500

I haven't been able to get the Zoiper Windows app to register.

I disabled the Subscribe for MWI and disabled both Presence settings on the Zoiper Preferences Advanced, but it still seems to be trying to subscrive for the MWI

<--- Received SIP request (740 bytes) from UDP:192.168.8.253:5065 --->
SUBSCRIBE sip:7003@192.168.11.39;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.8.253:5065;branch=z9hG4bK-d8754z-1f7b7d89791324d5-1---d8754z-
Max-Forwards: 70
Contact: <sip:7003@192.168.8.253:5065;transport=UDP>
To: "Dan Cropp"<sip:7003@192.168.11.39;transport=UDP>
From: "Dan Cropp"<sip:7003@192.168.11.39;transport=UDP>;tag=0a53bf02
Call-ID: NzgzZDU5YTY4YjI0NjcyNTViNTViZWExN2JiZjMxYzI.
CSeq: 1 SUBSCRIBE
Expires: 3600
Accept: application/simple-message-summary
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri
User-Agent: Z 3.2.21357 r21367
Event: message-summary
Allow-Events: presence, kpml
Content-Length: 0


<--- Transmitting SIP response (533 bytes) to UDP:192.168.8.253:5065 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.8.253:5065;rport;received=192.168.8.253;branch=z9hG4bK-d8754z-1f7b7d89791324d5-1---d8754z-
Call-ID: NzgzZDU5YTY4YjI0NjcyNTViNTViZWExN2JiZjMxYzI.
From: "Dan Cropp" <sip:7003@192.168.11.39>;tag=0a53bf02
To: "Dan Cropp" <sip:7003@192.168.11.39>;tag=z9hG4bK-d8754z-1f7b7d89791324d5-1---d8754z-
CSeq: 1 SUBSCRIBE
WWW-Authenticate: Digest  realm="asterisk",nonce="1395689794/69082ce37df7d8e72a8c5e6d48e090dd",opaque="6fe340b839f86d2b",algorithm=md5,qop="auth"
Content-Length:  0


<--- Received SIP request (1038 bytes) from UDP:192.168.8.253:5065 --->
SUBSCRIBE sip:7003@192.168.11.39;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.8.253:5065;branch=z9hG4bK-d8754z-b2504e30b70d7c60-1---d8754z-
Max-Forwards: 70
Contact: <sip:7003@192.168.8.253:5065;transport=UDP>
To: "Dan Cropp"<sip:7003@192.168.11.39;transport=UDP>
From: "Dan Cropp"<sip:7003@192.168.11.39;transport=UDP>;tag=0a53bf02
Call-ID: NzgzZDU5YTY4YjI0NjcyNTViNTViZWExN2JiZjMxYzI.
CSeq: 2 SUBSCRIBE
Expires: 3600
Accept: application/simple-message-summary
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri
User-Agent: Z 3.2.21357 r21367
Authorization: Digest username="7003",realm="asterisk",nonce="1395689794/69082ce37df7d8e72a8c5e6d48e090dd",uri="sip:7003@192.168.11.39;transport=UDP",response="2bed7b7fc104d264f2e84ac32b656538",cnonce="1d0eea64c6663180f877da53a2b9820d",nc=00000001,qop=auth,algorithm=md5,opaque="6fe340b839f86d2b"
Event: message-summary
Allow-Events: presence, kpml
Content-Length: 0


[Mar 24 19:36:34] WARNING[4908]: res_pjsip_mwi.c:521 mwi_subscribe_single: AOR 7003 has no configured mailboxes. MWI subscription failed
<--- Transmitting SIP response (395 bytes) to UDP:192.168.8.253:5065 --->
SIP/2.0 500 Internal Server Error
Via: SIP/2.0/UDP 192.168.8.253:5065;rport;received=192.168.8.253;branch=z9hG4bK-d8754z-b2504e30b70d7c60-1---d8754z-
Call-ID: NzgzZDU5YTY4YjI0NjcyNTViNTViZWExN2JiZjMxYzI.
From: "Dan Cropp" <sip:7003@192.168.11.39>;tag=0a53bf02
To: "Dan Cropp" <sip:7003@192.168.11.39>;tag=z9hG4bK-d8754z-b2504e30b70d7c60-1---d8754z-
CSeq: 2 SUBSCRIBE
Content-Length:  0


By: Dan Cropp (daninmadison) 2014-04-07 09:13:58.019-0500

Tried again today.
Cisco SPA504G phone and PhonerLite calling into my Asterisk PJSIP.  Crashes same as reported above.

I can get Zoiper to register with PJSIP.  However, when I try to call it's responding with unauthorized.
Today, I connected the Zoiper app up to a different VM running Asterisk using SIP.conf with the only modification being the IP Address.  Call worked without any problems.

I also verified that my pjproject is up to date with the latest in git.

Is there anything else you would like me to test and report the results on?

By: Rusty Newton (rnewton) 2014-04-21 15:44:06.722-0500

[~daninmadison] , I've used your exact configs as provided and cannot reproduce the issue.

I talked with Mark Michelson, who reviewed the backtrace and stated that this crash shouldn't have anything to do with the packets the phones are sending Asterisk.

Therefore the likely culprit is a bad/older/different installation of pjrproject on the system. Had you installed pjproject before you used our fork from git?

You may want to try uninstalling pjproject and after that, verifying there are no pjproject libraries existing on the system (verify the uninstallation was clean and that another version does not remain). There are [some instructions at this link|https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+pjproject?src=search#BuildingandInstallingpjproject-UninstallingaPreviousVersionofpjproject].

After that.. reinstall, you might even recompile Asterisk, and try again.

When you recompile Asterisk, be sure you have BETTER_BACKTRACES and DONT_OPTIMIZE set in Compiler Flags so that you can get a good backtrace in the case of another crash.

If the issue reoccurs, we will probably want more debug, following these instructions: https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information . Be sure that the debug and verbose messages are present in the log, as I didn't see either in your current log. Plus a packet capture along with that. That is an actual pcap.

By: Dan Cropp (daninmadison) 2014-04-28 09:35:47.545-0500

Thanks Rusty!

I can't think of any reason I would have had pjproject on my Linux system prior to attempting to use it with Asterisk.  
(We do have other Windows based applications that have used PJSIP for several years, which is one of the reasons we're very excited to see Asterisk using PJSIP).

I will follow the instructions to remove all project references just to be safe.
If I still run into problems, I'll start with a fresh Linux install and step through it again just to verify.
If I still run into problems, I will turn on the extra flags and get more information.  I will send an update some time this week.


By: Dan Cropp (daninmadison) 2014-04-30 16:47:44.421-0500

I have been trying to build a fresh system for this, but can no longer get the pjproject shared files to update.  It seems like everything compiles and installs.  However, the ldconfig is not working (yes, I'm using superuser).

I'm following the directions located at...
https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+pjproject


By: Dan Cropp (daninmadison) 2014-05-01 09:12:04.228-0500

Figured out why it wouldn't update the shared library links.
By default, the debian install package I have didn't include the /usr/lib/lib folder.  

Had to add /usr/lib/lib to the list of folders to include.

One thing I forgot to mention is whenever I install the pjproject and update the shared library links, I'm always seeing .so and .so.2 files....

sudo ldconfig -p | grep pj
       libpjsua2.so.2 (libc6,x86-64) => /usr/lib/lib/libpjsua2.so.2
       libpjsua2.so (libc6,x86-64) => /usr/lib/lib/libpjsua2.so
       libpjsua.so.2 (libc6,x86-64) => /usr/lib/lib/libpjsua.so.2
       libpjsua.so (libc6,x86-64) => /usr/lib/lib/libpjsua.so
       libpjsip.so.2 (libc6,x86-64) => /usr/lib/lib/libpjsip.so.2
       libpjsip.so (libc6,x86-64) => /usr/lib/lib/libpjsip.so
       libpjsip-ua.so.2 (libc6,x86-64) => /usr/lib/lib/libpjsip-ua.so.2
       libpjsip-ua.so (libc6,x86-64) => /usr/lib/lib/libpjsip-ua.so
       libpjsip-simple.so.2 (libc6,x86-64) => /usr/lib/lib/libpjsip-simple.so.2
       libpjsip-simple.so (libc6,x86-64) => /usr/lib/lib/libpjsip-simple.so
       libpjnath.so.2 (libc6,x86-64) => /usr/lib/lib/libpjnath.so.2
       libpjnath.so (libc6,x86-64) => /usr/lib/lib/libpjnath.so
       libpjmedia.so.2 (libc6,x86-64) => /usr/lib/lib/libpjmedia.so.2
       libpjmedia.so (libc6,x86-64) => /usr/lib/lib/libpjmedia.so
       libpjmedia-videodev.so.2 (libc6,x86-64) => /usr/lib/lib/libpjmedia-videodev.so.2
       libpjmedia-videodev.so (libc6,x86-64) => /usr/lib/lib/libpjmedia-videodev.so
       libpjmedia-codec.so.2 (libc6,x86-64) => /usr/lib/lib/libpjmedia-codec.so.2
       libpjmedia-codec.so (libc6,x86-64) => /usr/lib/lib/libpjmedia-codec.so
       libpjmedia-audiodev.so.2 (libc6,x86-64) => /usr/lib/lib/libpjmedia-audiodev.so.2
       libpjmedia-audiodev.so (libc6,x86-64) => /usr/lib/lib/libpjmedia-audiodev.so
       libpjlib-util.so.2 (libc6,x86-64) => /usr/lib/lib/libpjlib-util.so.2
       libpjlib-util.so (libc6,x86-64) => /usr/lib/lib/libpjlib-util.so
       libpj.so.2 (libc6,x86-64) => /usr/lib/lib/libpj.so.2
       libpj.so (libc6,x86-64) => /usr/lib/lib/libpj.so


By: Rusty Newton (rnewton) 2014-05-01 09:27:05

Those are different versions of the libraries. http://unix.stackexchange.com/questions/475/how-do-so-shared-object-numbers-work

I'm going to close this bug report out, as right now we can't reproduce and it seems to be a installation issue. You can continue asking questions on the asterisk-users mailing list and we'll try to help out there. We can always re-open if we figure out there is a bug here that we want to go investigate.

By: Dan Cropp (daninmadison) 2014-05-01 15:03:04.159-0500

Thanks Rusty.  
I wish I had the system from before to figure out what I did wrong with the install before.

Just finished the install on the new VM and everything worked right away.  First call worked flawlessly.

Sorry for any inconvenience I caused.