jack0402 / csipsimple

Automatically exported from code.google.com/p/csipsimple
0 stars 0 forks source link

Redial from call history ignores nonstandard SIP provider port #2620

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Register with a SIP provider not using port 5060 (5060 blocked)
2. Receive an incoming call; call history shows number@server
4. Pressing the callback button fails as csipsimple attempts connection to SIP 
provider using default port 5060

What is the expected output? What do you see instead?
csipsimple should issue sip commands to same SIP registration port as specified 
in the configuration page and not default to 5060.

What version of the product are you using? On what device / operating
system?
Nexus 4 stock Android 4.2.2
1.02.00 r2330

Please provide any additional information below.
Making direct calls from address book or just dial pad works fine. Incoming 
calls work fine. Phone is not behind a NAT, using cellular LTE. Using the 
callback/callagain feature from the call history page works fine if the call 
was originated from the phone - the server name is followed by the correct port 
number ie. number@server.com:xxxx

Original issue reported on code.google.com by darryl....@gmail.com on 12 Jan 2014 at 6:23

GoogleCodeExporter commented 9 years ago
Log snips...

D/PjService( 3064): Found pjsua 2 searching 2
D/RegHandlerReceiver( 3064): We restore 
<sip:darryl@25.87.105.246:44461;transport=TCP;ob>
D/libpjsip( 3064): 10:17:44.722 mobile_reg_han  ....The register already has 
old contact in it, ignore
D/libpjsip( 3064): 10:17:44.722   pjsua_core.c  ....TX 936 bytes Request msg 
REGISTER/cseq=60670 (tdta0x2a458490) to TCP 173.255.213.166:7770:
D/libpjsip( 3064): REGISTER sip:173.255.213.166:7770;transport=tcp;lr SIP/2.0
D/libpjsip( 3064): Via: SIP/2.0/TCP 
25.87.105.246:38134;rport;branch=z9hG4bKPj7ODfwFUVLMnzvfEZfaFiUyEXON2nkjwM;alias
D/libpjsip( 3064): Max-Forwards: 70
D/libpjsip( 3064): From: 
<sip:darryl@173.255.213.166>;tag=Ok5z.DW7KF-y4nhsDuhGER5eOrS6XY7T
D/libpjsip( 3064): To: <sip:darryl@173.255.213.166>
D/libpjsip( 3064): Call-ID: gnDiw6r94gbgrG9x3BX9PE.fO7XrRll3
D/libpjsip( 3064): CSeq: 60670 REGISTER
D/libpjsip( 3064): User-Agent: CSipSimple_mako-19/r2330
D/libpjsip( 3064): Supported: outbound, path
D/libpjsip( 3064): Contact: <sip:darryl@24.114.39.46:55260;transport=TCP;ob>
D/libpjsip( 3064): Contact: 
<sip:darryl@25.87.105.246:44461;transport=TCP;ob>;expires=0;reg-id=1;+sip.instan
ce="<urn:uuid:00000000-0000-0000-0000-0000e922f243>"
D/libpjsip( 3064): Expires: 900
D/libpjsip( 3064): Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, 
SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
D/libpjsip( 3064): Authorization: Digest username="darryl", realm="asterisk", 
nonce="232eab6b", uri="sip:173.255.213.166:7770;transport=tcp;lr", 
response="2c17f5198b060817570bfa02f0b8f58b", algorithm=MD5
D/libpjsip( 3064): Content-Length:  0
D/libpjsip( 3064): 
D/libpjsip( 3064): --end msg--
D/libpjsip( 3064): 10:17:44.843   pjsua_core.c  .RX 613 bytes Response msg 
200/REGISTER/cseq=60670 (rdata0x2a45d11c) from TCP 173.255.213.166:7770:
D/libpjsip( 3064): SIP/2.0 200 OK
D/libpjsip( 3064): Via: SIP/2.0/TCP 
25.87.105.246:38134;branch=z9hG4bKPj7ODfwFUVLMnzvfEZfaFiUyEXON2nkjwM;alias;recei
ved=24.114.39.46;rport=55260
D/libpjsip( 3064): From: 
<sip:darryl@173.255.213.166>;tag=Ok5z.DW7KF-y4nhsDuhGER5eOrS6XY7T
D/libpjsip( 3064): To: <sip:darryl@173.255.213.166>;tag=as6a0b3b6a
D/libpjsip( 3064): Call-ID: gnDiw6r94gbgrG9x3BX9PE.fO7XrRll3
D/libpjsip( 3064): CSeq: 60670 REGISTER
D/libpjsip( 3064): Server: Asterisk PBX 11.6.0
D/libpjsip( 3064): Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, 
NOTIFY, INFO, PUBLISH
D/libpjsip( 3064): Supported: replaces, timer
D/libpjsip( 3064): Expires: 900
D/libpjsip( 3064): Contact: 
<sip:darryl@24.114.39.46:55260;transport=TCP;ob>;expires=900
D/libpjsip( 3064): Date: Sun, 12 Jan 2014 18:17:44 GMT
D/libpjsip( 3064): Content-Length: 0
D/libpjsip( 3064): 
D/libpjsip( 3064): --end msg--
D/libpjsip( 3064): 10:17:44.843 mobile_reg_han  .mod_reg_tracker_on_rx_response
D/libpjsip( 3064): 10:17:44.843 mobile_reg_han  .mod_reg_tracker_on_rx_response 
2
D/libpjsip( 3064): 10:17:44.843 mobile_reg_han  .Hook a REGISTER RX response !!!
D/libpjsip( 3064): 10:17:44.843 mobile_reg_han  . Hook should save contact : 
<sip:darryl@24.114.39.46:55260;transport=TCP;ob> > 900
D/PjService( 3064): Found pjsua 2 searching 2
D/libpjsip( 3064): 10:17:44.867 mobile_reg_han  .mod_reg_tracker_on_rx_response 
done
D/libpjsip( 3064): 10:17:44.881    pjsua_acc.c  ....SIP outbound status for acc 
2 is not active
I/libpjsip( 3064): 10:17:44.881    pjsua_acc.c  .... 
<sip:darryl@173.255.213.166>: registration success, status=200 (OK), will 
re-register in 900 seconds
D/libpjsip( 3064): 10:17:44.881   pjsua_pres.c  ....Starting MWI subscription..
D/libpjsip( 3064): 10:17:44.884   pjsua_core.c  .......TX 628 bytes Request msg 
SUBSCRIBE/cseq=31457 (tdta0x2a1e4db8) to UDP 173.255.213.166:5060:
D/libpjsip( 3064): SUBSCRIBE sip:darryl@173.255.213.166 SIP/2.0
D/libpjsip( 3064): Via: SIP/2.0/UDP 
25.87.105.246:34594;rport;branch=z9hG4bKPjQARxigp1UceHV3IPgpyZYkiRFX5qRDJW
D/libpjsip( 3064): Max-Forwards: 70
D/libpjsip( 3064): From: 
<sip:darryl@173.255.213.166>;tag=T7QMXiQx9IWliTIj21dmqyUOW6F.Csex
D/libpjsip( 3064): To: <sip:darryl@173.255.213.166>
D/libpjsip( 3064): Contact: <sip:darryl@24.114.39.46:55260;transport=TCP;ob>
D/libpjsip( 3064): Call-ID: fa-zFlbZIStuQtIOQq1iAt77J1wP8fCe
D/libpjsip( 3064): CSeq: 31457 SUBSCRIBE
D/libpjsip( 3064): Event: message-summary
D/libpjsip( 3064): Expires: 3600
D/libpjsip( 3064): Supported: replaces, 100rel, timer, norefersub
D/libpjsip( 3064): Accept: application/simple-message-summary
D/libpjsip( 3064): Allow-Events: presence, message-summary, refer
D/libpjsip( 3064): User-Agent: CSipSimple_mako-19/r2330
D/libpjsip( 3064): Content-Length:  0
D/libpjsip( 3064): 
D/libpjsip( 3064): --end msg--
D/libpjsip( 3064): 10:17:44.899 evsub0x2a1b7a0  .........Subscription state 
changed NULL --> SENT
D/libpjsip( 3064): 10:17:44.899   pjsua_pres.c  ..........MWI subscription for  
<sip:darryl@173.255.213.166> is SENT
D/SIP UA Receiver( 3064): < LOCK CPU
D/SIP UA Receiver( 3064): > UNLOCK CPU 0
D/PjService( 3064): Found pjsua 2 searching 2
D/PjService( 3064): Update profile from service for 2 aka in db 1
D/DBProvider( 3064): Updated status_text=OK status_code=200 display_name=mb 
expires=894 account_id=1 added_status=0 priority=100 active=true wizard=EXPERT 
reg_uri=sip:173.255.213.166:7770 pjsua_id=2
D/AccountChooserButton( 5878): Accounts status.onChange( false)
D/PjService( 3064): Profile state UP : status_text=OK status_code=200 
expires=894
D/SIP SRV ( 3064): Accounts status.onChange( false)
D/SIP SRV ( 3064): Update registration state

D/libpjsip( 3064): 10:31:16.845 evsub0x2a1a805  ...Subscription state changed 
SENT --> TERMINATED
D/libpjsip( 3064): 10:31:16.845   pjsua_pres.c  ....MWI subscription for  
<sip:darryl@173.255.213.166> is TERMINATED
D/libpjsip( 3064): 10:31:16.845 evsub0x2a1a805  ...Subscription destroyed
D/libpjsip( 3064): 10:31:21.788   pjsua_core.c  .TX 985 bytes Request msg 
INVITE/cseq=8395 (tdta0x2a4231a0) to UDP 173.255.213.166:5060:
D/libpjsip( 3064): INVITE sip:6043679618@173.255.213.166 SIP/2.0
D/libpjsip( 3064): Via: SIP/2.0/UDP 
25.87.105.246:52097;rport;branch=z9hG4bKPj9eFHz0LNOW1LoI0GMqV9p-FkcYmf146f
D/libpjsip( 3064): Max-Forwards: 70
D/libpjsip( 3064): From: 
<sip:darryl@173.255.213.166>;tag=g3j7vbtpYtoJgSUua6Lkd5Vn49TKKS6F
D/libpjsip( 3064): To: <sip:6043679618@173.255.213.166>
D/libpjsip( 3064): Contact: <sip:darryl@24.114.39.46:55278;transport=TCP;ob>
D/libpjsip( 3064): Call-ID: OMIY8MtHWFJymCeJ8HsKGBxc0qbSjYct
D/libpjsip( 3064): CSeq: 8395 INVITE
D/libpjsip( 3064): Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, 
SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
D/libpjsip( 3064): Supported: replaces, 100rel, timer, norefersub
D/libpjsip( 3064): Session-Expires: 1800
D/libpjsip( 3064): Min-SE: 90
D/libpjsip( 3064): User-Agent: CSipSimple_mako-19/r2330
D/libpjsip( 3064): Content-Type: application/sdp
D/libpjsip( 3064): Content-Length:   320
D/libpjsip( 3064): 
D/libpjsip( 3064): v=0
D/libpjsip( 3064): o=- 3598540250 3598540250 IN IP4 25.87.105.246
D/libpjsip( 3064): s=pjmedia
D/libpjsip( 3064): c=IN IP4 25.87.105.246
D/libpjsip( 3064): t=0 0
D/libpjsip( 3064): m=audio 10000 RTP/AVP 3 96 101
D/libpjsip( 3064): c=IN IP4 25.87.105.246
D/libpjsip( 3064): a=rtcp:10001 IN IP4 25.87.105.246
D/libpjsip( 3064): a=sendrecv
D/libpjsip( 3064): a=rtpmap:3 GSM/8000
D/libpjsip( 3064): a=rtpmap:96 SILK/8000
D/libpjsip( 3064): a=fmtp:96 useinbandfec=0
D/libpjsip( 3064): a=rtpmap:101 telephone-event/8000
D/libpjsip( 3064): a=fmtp:101 0-15
D/libpjsip( 3064): --end msg--
D/SIP UA Receiver( 3064): < LOCK CPU
D/SIP UA Receiver( 3064): Call TSX state <<
D/SIP UA Receiver( 3064): Updating call infos from the stack
D/PjSipCalls( 3064): Update call 0
D/PjService( 3064): Found pjsua 2 searching 2
D/PjSipCalls( 3064): Last status code is 408
D/SIP UA Receiver( 3064): Call TSX state >>
D/SIP UA Receiver( 3064): > UNLOCK CPU 0
I/libpjsip( 3064): 10:31:22.254 pjsua_jni_addo  ....Call 0 is DISCONNECTED 
[reason=408 (Request Timeout)]

Original comment by darryl....@gmail.com on 12 Jan 2014 at 6:45

GoogleCodeExporter commented 9 years ago
Thanks for the report
Can you send logs using the HowToCollectLogs wiki page instructions?
Also when you reproduce, do not forget to include the previous call scenario. 
It will include the remote from send by the other.

What you observe can be totally expected if remote send sip uri without port 
and/or if you didn't configured your account with the "proxy field" set.
Indeed, the account should *not* use the registration port as you said in your 
description. This port, as it's name suggest is for registration. For calls, if 
proxy is set, it will send on your sip proxy configured, else it will resolved 
based on the sip uri it has to call. This applies to domain, port and 
transport. This is the way any sip client should behaves if it allows to 
address all possible topologies.
Note that I recommend to use proxy value always set and that what's done by the 
wizard "basic" designed for mainstream users.

Original comment by r3gis...@gmail.com on 12 Jan 2014 at 8:09

GoogleCodeExporter commented 9 years ago
Wow, thank you for the fast response and you're completely correct. My concern 
was based on the sip invite being sent to port 5060, but as you said this is by 
design per the sip uri for maximum flexibility.

I had originally configured csip via the Advanced wizard to specify the TCP 
preference and using the proxy setting had not even occurred to me. Your advice 
has resolved my use case issue.

There's always so much to learn and I appreciate your time. Thank you and keep 
up the great work!

Original comment by darryl....@gmail.com on 12 Jan 2014 at 8:42

GoogleCodeExporter commented 9 years ago
I think I have the same problem outlined here. All the numbers in my call 
history are recorded as number@server and they don't go through when I try to 
re-dial. 

What exactly should I do? I use Anveo, do I need put sip.anveo.com in the proxy 
server?Should I add a port number? 

Many thanks!

Original comment by the...@gmail.com on 16 Nov 2014 at 9:41