[Freeswitch-users] FreeSWITCH using same Call-ID for forked calls

Örn Arnarson orn at arnarson.net
Wed Mar 18 21:26:36 MSK 2015


Hello,

Not sure whether this belong in the users list or the dev list, but when in
doubt; start with users :-)

I am using FreeSWITCH as an SBC, talking to Kamailio on one and and
Asterisk on the other, and am seeing some strange behavior when calls are
being forked on the Asterisk.

Call setup is like this:
1. FreeSWITCH receives INVITE from Kamailio
2. FreeSWITCH sends INVITE to Asterisk with new Call-ID
3. Asterisk forks call, sends out multiple INVITEs back to FreeSWITCH (each
with a unique call-id)
4. FreeSWITCH sends multiple INVITEs to Kamailio, each with the new Call-ID
from step 2.

This is causing problems with one of the MGWs behind Kamailio, which is
seeing multiple INVITEs to different destinations with the same Call-ID.

So, firstly, why is FreeSWITCH reusing call-ids?

Secondly, how is it matching up the calls? I can't find anything common in
the INVITEs, other than the source number and obviously that the IP sent to
and received from is the same.

I'm not sure if this is intended behavior or not, but is there a way to
have FreeSWITCH not do that?

Regards,
Örn

P.S. Here is the sequence of INVITEs. I also have the console log (for a
different call) if needed.

*INVITE sent to FreeSWITCH by Kamailio:*
INVITE sip:5344446 at 172.25.200.111:5080 SIP/2.0
Record-Route: <sip:172.25.200.101;lr=on>
Via: SIP/2.0/UDP 172.25.200.101;branch=z9hG4bK165.08b3b5c4.0
Via: SIP/2.0/UDP 172.25.200.121:5080;rport=5080;branch=z9hG4bK9aFD5m2KKerHN
Max-Forwards: 16
From: "4151502" <sip:4151502 at 172.25.200.121>;tag=33vB4BmmDtU0B
To: <sip:5344446 at 172.25.200.101>
Call-ID: 84b63791-4839-1233-639f-00215e2db0e0
CSeq: 73014324 INVITE
Contact: <sip:mod_sofia at 172.25.200.121:5080>
User-Agent: FreeSWITCH-mod_sofia/1.2.7
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER,
REFER, NOTIFY
Supported: timer, precondition, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 229
X-FS-Support: update_display,send_info
Remote-Party-ID: "4151502" <sip:4151502 at 172.25.200.121
>;party=calling;screen=yes;privacy=off

v=0
o=FreeSWITCH 1426681750 1426681751 IN IP4 172.25.200.121
s=FreeSWITCH
c=IN IP4 172.25.200.121
t=0 0
m=audio 19026 RTP/AVP 8 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20


*INVITE sent to Asterisk by FreeSWITCH:*
INVITE sip:5344446 at 172.26.0.62:5060 SIP/2.0
Via: SIP/2.0/UDP 10.11.12.13;rport;branch=z9hG4bK0N733e7FHv4QF
Max-Forwards: 15
From: "4151502" <sip:4151502 at 10.11.12.13>;tag=2BaZj0t076Q9B
To: <sip:5344446 at 172.26.0.62:5060>
Call-ID: a7c77ea5-4839-1233-73b9-00215e2c8c90
CSeq: 73014353 INVITE
Contact: <sip:mod_sofia at 10.11.12.13:5060>
User-Agent: FreeSWITCH-mod_sofia/1.2.12
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER,
REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, precondition, path, replaces
Allow-Events: talk, hold, conference, presence, dialog, line-seize,
call-info, sla, include-session-description, presence.winfo,
message-summary, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 223
X-FS-Support: update_display,send_info
Remote-Party-ID: "4151502" <sip:4151502 at 10.11.12.13
>;party=calling;screen=yes;privacy=off

v=0
o=FreeSWITCH 1426677605 1426677606 IN IP4 10.11.12.13
s=FreeSWITCH
c=IN IP4 10.11.12.13
t=0 0
m=audio 23230 RTP/AVP 8 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20

*First INVITE sent to FreeSWITCH by Asterisk (forked call):*
INVITE sip:7712552 at 10.11.12.13 SIP/2.0
Via: SIP/2.0/UDP 172.26.0.62:5060;branch=z9hG4bK416db3f1;rport
Max-Forwards: 70
From: "4151502" <sip:4151502 at 172.26.0.62>;tag=as24a51ba6
To: <sip:7712552 at 10.11.12.13>
Contact: <sip:4151502 at 172.26.0.62:5060>
Call-ID: 135674a534fad0fd5bfff55c2fdc3280 at 172.26.0.62:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.8.15-cert2
Date: Wed, 18 Mar 2015 17:47:11 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH
Supported: replaces, timer
Diversion: <sip:5344446 at 172.26.0.62>
Content-Type: application/sdp
Content-Length: 312

v=0
o=root 693576967 693576967 IN IP4 172.26.0.62
s=Asterisk PBX 1.8.15-cert2
c=IN IP4 172.26.0.62
t=0 0
m=audio 30440 RTP/AVP 8 0 9 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16

Second INVITE sent to FreeSWITCH by Asterisk (forked call):
INVITE sip:6595454 at 10.11.12.13 SIP/2.0
Via: SIP/2.0/UDP 172.26.0.62:5060;branch=z9hG4bK6796aff1;rport
Max-Forwards: 70
From: "4151502" <sip:4151502 at 172.26.0.62>;tag=as22f810b0
To: <sip:6595454 at 10.11.12.13>
Contact: <sip:4151502 at 172.26.0.62:5060>
Call-ID: 6979c3dd69c5f8e557131e485466ad57 at 172.26.0.62:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.8.15-cert2
Date: Wed, 18 Mar 2015 17:47:11 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH
Supported: replaces, timer
Diversion: <sip:5344446 at 172.26.0.62>
Content-Type: application/sdp
Content-Length: 310

v=0
o=root 89056081 89056081 IN IP4 172.26.0.62
s=Asterisk PBX 1.8.15-cert2
c=IN IP4 172.26.0.62
t=0 0
m=audio 30708 RTP/AVP 8 0 9 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

*First INVITE sent by FreeSWITCH to Kamailio (call forked by Asterisk):*
INVITE sip:7712552 at 172.25.200.101 SIP/2.0
Via: SIP/2.0/UDP 172.25.200.111:5080;rport;branch=z9hG4bK3jvS9UyXU216H
Max-Forwards: 69
From: "4151502" <sip:4151502 at 172.25.200.111>;tag=Z6pSHe2eXSB2p
To: <sip:7712552 at 172.25.200.101>
Call-ID: a7d2b58b-4839-1233-73b9-00215e2c8c90
CSeq: 73014353 INVITE
Contact: <sip:mod_sofia at 172.25.200.111:5080>
User-Agent: FreeSWITCH-mod_sofia/1.2.12
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER,
REFER, NOTIFY
Supported: timer, precondition, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 209
Diversion: <sip:5344446 at 172.25.200.101>
X-FS-Support: update_display,send_info

v=0
o=FreeSWITCH 1426681031 1426681032 IN IP4 172.25.200.111
s=FreeSWITCH
c=IN IP4 172.25.200.111
t=0 0
m=audio 19804 RTP/AVP 8 0 9 101 13
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20

*Second INVITE sent by FreeSWITCH to Kamailio (call forked by Asterisk):*
INVITE sip:6595454 at 172.25.200.101 SIP/2.0
Via: SIP/2.0/UDP 172.25.200.111:5080;rport;branch=z9hG4bK4UNjBQF1rBrSD
Max-Forwards: 69
From: "4151502" <sip:4151502 at 172.25.200.111>;tag=0FgjK9jjt21mj
To: <sip:6595454 at 172.25.200.101>
Call-ID: a7d2dd62-4839-1233-73b9-00215e2c8c90
CSeq: 73014353 INVITE
Contact: <sip:mod_sofia at 172.25.200.111:5080>
User-Agent: FreeSWITCH-mod_sofia/1.2.12
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER,
REFER, NOTIFY
Supported: timer, precondition, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 209
Diversion: <sip:5344446 at 172.25.200.101>
X-FS-Support: update_display,send_info

v=0
o=FreeSWITCH 1426669459 1426669460 IN IP4 172.25.200.111
s=FreeSWITCH
c=IN IP4 172.25.200.111
t=0 0
m=audio 31376 RTP/AVP 8 0 9 101 13
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150318/29f08ed3/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list