3
votes

I am facing a strange problem when using the standard Android SIP Demo in combination with an asterisk 1.8.9.2 server: incoming / outgoing calls are working correctly, but there is one thing not working: when I launch a call from the SIP demo and I close the call again (hitting the "End current call" button), the call is terminated in the SIP demo, but the called device still keeps ringing.

I have tried to check what's happening by logging the telegrams via Wireshark and it seems that the CANCEL telegram from the SIP demo to the asterisk server is not accepted, take a look:

300 08:30:39.483913 130.10.0.102    192.168.0.110   SIP/SDP 916 Request: INVITE sip:[email protected]:5060, with session description
301 08:30:39.488686 192.168.0.110   130.10.0.102    SIP 525 Status: 100 Trying
302 08:30:39.524884 192.168.0.110   130.10.0.102    SIP 541 Status: 180 Ringing
309 08:30:41.041071 130.10.0.102    192.168.0.110   SIP 370 Request: CANCEL sip:[email protected]:5060
310 08:30:41.051545 192.168.0.110   130.10.0.102    SIP 526 Status: 481 Call/Transaction Does Not Exist

And now the real strange thing: If I repeat the same action, and before terminating the call through the "End current call" button I wait for ca. 7 seconds, the CANCEL is accepted and the call is terminated correctly:

646 08:31:05.571464 130.10.0.102    192.168.0.110   SIP/SDP 916 Request: INVITE sip:[email protected]:5060, with session description
647 08:31:05.576150 192.168.0.110   130.10.0.102    SIP 525 Status: 100 Trying
648 08:31:05.662345 192.168.0.110   130.10.0.102    SIP 541 Status: 180 Ringing
664 08:31:08.302561 130.10.0.102    192.168.0.110   SIP 389 Request: OPTIONS sip:192.168.0.110
665 08:31:08.312097 192.168.0.110   130.10.0.102    SIP 528 Status: 404 Not Found
698 08:31:13.370346 130.10.0.102    192.168.0.110   SIP 370 Request: CANCEL sip:[email protected]:5060
699 08:31:13.373570 192.168.0.110   130.10.0.102    SIP 513 Status: 487 Request Terminated
700 08:31:13.373912 192.168.0.110   130.10.0.102    SIP 497 Status: 200 OK

I have checked the contents of both CANCEL requests, and the structure is completely the same! Furthermore I have also tested a server with asterisk 1.6 and there I did NOT encounter this problem, the call is terminated correctly there! So it makes me believe that it has to do something with asterisk vers. 1.8.

Did anyone encounter similar problems and has some helpful hints for me? If further data is needed for analysis, just let me know! Thanks for your help, BR

Armin

3

3 Answers

4
votes

I was facing exactly same problem with Asterisk 1.8.11.0 and Android 2.3/4.0.3. There is a simple solution for this problem under the 'general' section of sip.conf file add following attribute with value equals to no.

[general]
.
.
pedantic=no 

I hope it will also work for you.....

0
votes

The SIP demo is just a demo :) It may not handle all situations correctly. Does it work with a 'real' SIP client? Use your favorite softphone app to verify. For Android, you can try SIPDroid. If it does, there is something missing from the SIP demo, if not, might be a problem with your Asterisk configuration.

0
votes

Unfortuntely SIPDroid uses another SIP stack then Gingerbread has installed natively. This is why you don't observe ignoring CANCEL method there. I was playing with android SIP stack for sample integration with AVSystem TR-069 ACS server and had the same observation. Don't know yet whether there is any fix for that. Track progress here: http://avsystem.com