<div dir="ltr"><div>Hello,</div><div><br></div><div>I noticed a strange thing while testing my Asterisk-Kamailio Realtime setup. In an INVITE the From and To headers contain the same number when calling through a Realtime integration setup. This happens when the INVITE leaves Asterisk.</div>
<div><br></div><div>Can you guys tell me what might be causing this? I have <a href="mailto:660@testers.com">660@testers.com</a> as a websocket client and <a href="mailto:700@testers.com">700@testers.com</a> (caller) using a Zoiper client (db output below). The call itself works, audio and all, only those headers are puzzling to me. I noticed this when I tried to add a label saying '700 calling' on my web page. The same thing happens when I call from 660 to 700. </div>
<div><br></div><div>My Asterisk is 11.11.0 running on CentOS 6.5.</div><div><br></div><div>An INVITE is sent from my client to Kamailio and then to Asterisk:</div><div>(both Kamailio and Asterisk are at 1.1.1.1)</div><div>
<br></div><div> INVITE <a href="mailto:sip%3A660@testers.com">sip:660@testers.com</a>;transport=UDP SIP/2.0</div><div> Record-Route: <sip:1.1.1.1;lr=on;ftag=fd070807></div><div> Via: SIP/2.0/UDP 1.1.1.1;branch=z9hG4bKf6e9.339dda0648d95af665c91db701754d98.0</div>
<div> Via: SIP/2.0/UDP 2.2.2.2:37730;rport=37730;branch=z9hG4bK-d8754z-7f27c9fc35574abb-1---d8754z-</div><div> Max-Forwards: 16</div><div> Contact: <sip:700@2.2.2.2:37730;transport=UDP></div><div>
To: <<a href="mailto:sip%3A660@testers.com">sip:660@testers.com</a>;transport=UDP></div><div> From: <<a href="mailto:sip%3A700@testers.com">sip:700@testers.com</a>;transport=UDP>;tag=fd070807</div>
<div> Call-ID: ZDc0YjU1ZjNmMWI5YjUyYzY0YWNjN2NjN2NkODg2OTk.</div><div> CSeq: 2 INVITE</div><div> Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE</div><div> Content-Type: application/sdp</div>
<div> Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri</div><div> User-Agent: Z 3.2.21357 r21367</div><div> Allow-Events: presence, kpml</div><div> Content-Length: 239</div>
<div><br></div><div> v=0</div><div> o=Z 0 0 IN IP4 2.2.2.2</div><div> s=Z</div><div> c=IN IP4 2.2.2.2</div><div> t=0 0</div><div> m=audio 8000 RTP/AVP 3 110 8 0 98 101</div><div> a=rtpmap:110 speex/8000</div>
<div> a=rtpmap:98 iLBC/8000</div><div> a=fmtp:98 mode=20</div><div> a=rtpmap:101 telephone-event/8000</div><div> a=fmtp:101 0-15</div><div> a=sendrecv</div><div><br></div><div>... and Asterisk responds with Trying:</div>
<div><br></div><div> SIP/2.0 100 Trying</div><div> Via: SIP/2.0/UDP 1.1.1.1;branch=z9hG4bKf6e9.339dda0648d95af665c91db701754d98.0;received=1.1.1.1;rport=5060</div><div> Via: SIP/2.0/UDP 2.2.2.2:37730;rport=37730;branch=z9hG4bK-d8754z-7f27c9fc35574abb-1---d8754z-</div>
<div> Record-Route: <sip:1.1.1.1;lr=on;ftag=fd070807></div><div> From: <<a href="mailto:sip%3A700@testers.com">sip:700@testers.com</a>;transport=UDP>;tag=fd070807</div><div> To: <<a href="mailto:sip%3A660@testers.com">sip:660@testers.com</a>;transport=UDP></div>
<div> Call-ID: ZDc0YjU1ZjNmMWI5YjUyYzY0YWNjN2NjN2NkODg2OTk.</div><div> CSeq: 2 INVITE</div><div> Server: I Am the Devil</div><div> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE</div>
<div> Supported: replaces, timer</div><div> Session-Expires: 1800;refresher=uas</div><div> Contact: <<a href="http://sip:660@1.1.1.1:5070">sip:660@1.1.1.1:5070</a>></div><div> Content-Length: 0</div>
<div><br></div><div>And when Asterisk sends out the INVITE, From and To headers both have the same number:</div><div><br></div><div> INVITE <a href="http://sip:660@1.1.1.1:5060">sip:660@1.1.1.1:5060</a> SIP/2.0</div>
<div> Via: SIP/2.0/UDP 1.1.1.1:5070;branch=z9hG4bK75de61d0;rport</div><div> Max-Forwards: 70</div><div> From: <<a href="mailto:sip%3A660@testers.com">sip:660@testers.com</a>>;tag=as7b7c32a5</div>
<div> To: <<a href="http://sip:660@1.1.1.1:5060">sip:660@1.1.1.1:5060</a>></div><div> Contact: <<a href="http://sip:660@1.1.1.1:5070">sip:660@1.1.1.1:5070</a>></div><div> Call-ID: <a href="mailto:7240b8a011890ec677f185f4548583f4@testers.com">7240b8a011890ec677f185f4548583f4@testers.com</a></div>
<div> CSeq: 102 INVITE</div><div> User-Agent: I Am the Devil</div><div> Date: Wed, 06 Aug 2014 09:54:35 GMT</div><div> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE</div>
<div> Supported: replaces, timer</div><div> Content-Type: application/sdp</div><div> Content-Length: 801</div><div><br></div><div> v=0</div><div> o=root 969416519 969416519 IN IP4 1.1.1.1</div>
<div> s=Asterisk PBX 11.11.0</div><div> c=IN IP4 1.1.1.1</div><div> t=0 0</div><div> m=audio 18740 RTP/SAVPF 0 3 8 101</div><div> a=rtpmap:0 PCMU/8000</div><div> a=rtpmap:3 GSM/8000</div>
<div> a=rtpmap:8 PCMA/8000</div><div> a=rtpmap:101 telephone-event/8000</div><div> a=fmtp:101 0-16</div><div> a=ptime:20</div><div> a=ice-ufrag:50d777041673316422560b90281fcd2e</div><div>
a=ice-pwd:0093fdde724f8a411742661c31c90f21</div><div> a=candidate:H5bdd423d 1 UDP 2130706431 1.1.1.1 18740 typ host</div><div> a=candidate:S5bdd423d 1 UDP 1694498815 1.1.1.1 18740 typ srflx</div><div>
a=candidate:H5bdd423d 2 UDP 2130706430 1.1.1.1 18741 typ host</div><div> a=candidate:S5bdd423d 2 UDP 1694498814 1.1.1.1 18742 typ srflx</div><div> a=connection:new</div><div> a=setup:actpass</div>
<div> a=fingerprint:SHA-256 CE:EE:D9:28:EA:B0:6E:D0:CE:4F:5A:9A:FB:53:66:74:83:47:18:37:2F:76:C1:6D:10:C0:EE:FF:A4:56:F4:05</div><div> a=sendrecv</div><div><br></div><div><br></div><div>Here's the dialplan, nothing special:</div>
<div><br></div><div>exten => _XXX,1,NoOp(general : Dialed ${EXTEN})</div><div> same => n,Dial(SIP/${EXTEN},3600,rt)</div><div> same => n,Hangup</div><div><br></div><div><br></div><div>And here's how the clients are set in my db:</div>
<div><br></div><div> id: 4</div><div> name: 660</div><div> ipaddr: 1.1.1.1</div><div> port: 5060</div><div> regseconds: 1407320692</div><div> defaultuser: 660</div><div> fullcontact: <a href="http://sip:660@1.1.1.1:5060">sip:660@1.1.1.1:5060</a></div>
<div> regserver:</div><div> useragent:</div><div> lastms: 0</div><div> host: dynamic</div><div> type: friend</div><div> context: default</div><div> deny: <a href="http://0.0.0.0/0.0.0.0">0.0.0.0/0.0.0.0</a></div>
<div> permit: 1.1.1.1</div><div> secret: NULL</div><div> md5secret: NULL</div><div> avpf: yes</div><div> force_avp: yes</div><div> icesupport: yes</div><div> directmedia: no</div><div> encryption: yes</div>
<div> nat: force_rport,comedia</div><div> callgroup: NULL</div><div> pickupgroup: NULL</div><div> language: NULL</div><div> disallow: NULL</div><div> allow: NULL</div><div> setvar: NULL</div>
<div> callerid: NULL</div><div> amaflags: NULL</div><div> videosupport: no</div><div>maxcallbitrate: NULL</div><div> mailbox: NULL</div><div> regexten: NULL</div><div> fromdomain: <a href="http://testers.com">testers.com</a></div>
<div> fromuser: 660</div><div> qualify: NULL</div><div> defaultip: NULL</div><div> outboundproxy: 1.1.1.1</div><div> contactpermit: NULL</div><div> contactdeny: NULL</div><div> fullname: NULL</div><div>
cid_number: NULL</div><div> callingpres: NULL</div><div> mohinterpret: NULL</div><div> mohsuggest: NULL</div><div> hasvoicemail: NULL</div><div> subscribemwi: NULL</div><div> vmexten: NULL</div><div> rtpkeepalive: NULL</div>
<div>directrtpsetup: yes</div><div> dtlsenable: yes</div><div> dtlsverify: no</div><div>dtlsprivatekey: /etc/asterisk/keys/asterisk.pem</div><div> dtlssetup: actpass</div><div> dtlscertfile: /etc/asterisk/keys/asterisk.pem</div>
<div> dtlscafile: /etc/asterisk/keys/ca.crt</div><div> sippasswd: a84a4ddcda13d13c9573d5294047b6a2</div><div> rpid: NULL</div><div> domain: <a href="http://testers.com">testers.com</a></div><div> sippasswd2: NULL</div>
<div><br></div><div> id: 8</div><div> name: 700</div><div> ipaddr: 1.1.1.1</div><div> port: 5060</div><div> regseconds: 1407323638</div><div> defaultuser: 700</div><div> fullcontact: <a href="http://sip:700@1.1.1.1:5060">sip:700@1.1.1.1:5060</a></div>
<div> regserver:</div><div> useragent:</div><div> lastms: 0</div><div> host: dynamic</div><div> type: friend</div><div> context: default</div><div> deny: <a href="http://0.0.0.0/0.0.0.0">0.0.0.0/0.0.0.0</a></div>
<div> permit: 1.1.1.1</div><div> secret: NULL</div><div> md5secret: NULL</div><div> avpf: no</div><div> force_avp: NULL</div><div> icesupport: NULL</div><div> directmedia: NULL</div><div>
encryption: NULL</div><div> nat: force_rport,comedia</div><div> callgroup: NULL</div><div> pickupgroup: NULL</div><div> language: NULL</div><div> disallow: NULL</div><div> allow: NULL</div>
<div> setvar: NULL</div><div> callerid: NULL</div><div> amaflags: NULL</div><div> videosupport: yes</div><div>maxcallbitrate: NULL</div><div> mailbox: NULL</div><div> regexten: NULL</div><div>
fromdomain: <a href="http://testers.com">testers.com</a></div><div> fromuser: 700</div><div> qualify: NULL</div><div> defaultip: NULL</div><div> outboundproxy: 1.1.1.1</div><div> contactpermit: NULL</div>
<div> contactdeny: NULL</div><div> fullname: NULL</div><div> cid_number: NULL</div><div> callingpres: NULL</div><div> mohinterpret: NULL</div><div> mohsuggest: NULL</div><div> hasvoicemail: NULL</div><div>
subscribemwi: NULL</div><div> vmexten: NULL</div><div> rtpkeepalive: NULL</div><div>directrtpsetup: NULL</div><div> dtlsenable: NULL</div><div> dtlsverify: NULL</div><div>dtlsprivatekey: NULL</div><div> dtlssetup: NULL</div>
<div> dtlscertfile: NULL</div><div> dtlscafile: NULL</div><div> sippasswd: 2ef16ba6cda5dcd34088f4127b90048b</div><div> rpid: NULL</div><div> domain: <a href="http://testers.com">testers.com</a></div>
<div> sippasswd2: NULL</div><div><br></div><div><br></div><div><br></div><div><br></div><div>cheers,</div><div>Olli</div></div>