Olli Heiskanen
2014-Aug-06 10:28 UTC
[asterisk-users] From and To headers contain same account in INVITEs
Hello,
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.
Can you guys tell me what might be causing this? I have 660 at testers.com as
a websocket client and 700 at testers.com (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.
My Asterisk is 11.11.0 running on CentOS 6.5.
An INVITE is sent from my client to Kamailio and then to Asterisk:
(both Kamailio and Asterisk are at 1.1.1.1)
INVITE sip:660 at testers.com;transport=UDP SIP/2.0
Record-Route: <sip:1.1.1.1;lr=on;ftag=fd070807>
Via: SIP/2.0/UDP
1.1.1.1;branch=z9hG4bKf6e9.339dda0648d95af665c91db701754d98.0
Via: SIP/2.0/UDP 2.2.2.2:37730
;rport=37730;branch=z9hG4bK-d8754z-7f27c9fc35574abb-1---d8754z-
Max-Forwards: 16
Contact: <sip:700 at 2.2.2.2:37730;transport=UDP>
To: <sip:660 at testers.com;transport=UDP>
From: <sip:700 at testers.com;transport=UDP>;tag=fd070807
Call-ID: ZDc0YjU1ZjNmMWI5YjUyYzY0YWNjN2NjN2NkODg2OTk.
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS,
INFO, SUBSCRIBE
Content-Type: application/sdp
Supported: replaces, norefersub, extended-refer, timer,
X-cisco-serviceuri
User-Agent: Z 3.2.21357 r21367
Allow-Events: presence, kpml
Content-Length: 239
v=0
o=Z 0 0 IN IP4 2.2.2.2
s=Z
c=IN IP4 2.2.2.2
t=0 0
m=audio 8000 RTP/AVP 3 110 8 0 98 101
a=rtpmap:110 speex/8000
a=rtpmap:98 iLBC/8000
a=fmtp:98 mode=20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
... and Asterisk responds with Trying:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP
1.1.1.1;branch=z9hG4bKf6e9.339dda0648d95af665c91db701754d98.0;received=1.1.1.1;rport=5060
Via: SIP/2.0/UDP 2.2.2.2:37730
;rport=37730;branch=z9hG4bK-d8754z-7f27c9fc35574abb-1---d8754z-
Record-Route: <sip:1.1.1.1;lr=on;ftag=fd070807>
From: <sip:700 at testers.com;transport=UDP>;tag=fd070807
To: <sip:660 at testers.com;transport=UDP>
Call-ID: ZDc0YjU1ZjNmMWI5YjUyYzY0YWNjN2NjN2NkODg2OTk.
CSeq: 2 INVITE
Server: I Am the Devil
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:660 at 1.1.1.1:5070>
Content-Length: 0
And when Asterisk sends out the INVITE, From and To headers both have the
same number:
INVITE sip:660 at 1.1.1.1:5060 SIP/2.0
Via: SIP/2.0/UDP 1.1.1.1:5070;branch=z9hG4bK75de61d0;rport
Max-Forwards: 70
From: <sip:660 at testers.com>;tag=as7b7c32a5
To: <sip:660 at 1.1.1.1:5060>
Contact: <sip:660 at 1.1.1.1:5070>
Call-ID: 7240b8a011890ec677f185f4548583f4 at testers.com
CSeq: 102 INVITE
User-Agent: I Am the Devil
Date: Wed, 06 Aug 2014 09:54:35 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 801
v=0
o=root 969416519 969416519 IN IP4 1.1.1.1
s=Asterisk PBX 11.11.0
c=IN IP4 1.1.1.1
t=0 0
m=audio 18740 RTP/SAVPF 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=ice-ufrag:50d777041673316422560b90281fcd2e
a=ice-pwd:0093fdde724f8a411742661c31c90f21
a=candidate:H5bdd423d 1 UDP 2130706431 1.1.1.1 18740 typ host
a=candidate:S5bdd423d 1 UDP 1694498815 1.1.1.1 18740 typ srflx
a=candidate:H5bdd423d 2 UDP 2130706430 1.1.1.1 18741 typ host
a=candidate:S5bdd423d 2 UDP 1694498814 1.1.1.1 18742 typ srflx
a=connection:new
a=setup:actpass
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
a=sendrecv
Here's the dialplan, nothing special:
exten => _XXX,1,NoOp(general : Dialed ${EXTEN})
same => n,Dial(SIP/${EXTEN},3600,rt)
same => n,Hangup
And here's how the clients are set in my db:
id: 4
name: 660
ipaddr: 1.1.1.1
port: 5060
regseconds: 1407320692
defaultuser: 660
fullcontact: sip:660 at 1.1.1.1:5060
regserver:
useragent:
lastms: 0
host: dynamic
type: friend
context: default
deny: 0.0.0.0/0.0.0.0
permit: 1.1.1.1
secret: NULL
md5secret: NULL
avpf: yes
force_avp: yes
icesupport: yes
directmedia: no
encryption: yes
nat: force_rport,comedia
callgroup: NULL
pickupgroup: NULL
language: NULL
disallow: NULL
allow: NULL
setvar: NULL
callerid: NULL
amaflags: NULL
videosupport: no
maxcallbitrate: NULL
mailbox: NULL
regexten: NULL
fromdomain: testers.com
fromuser: 660
qualify: NULL
defaultip: NULL
outboundproxy: 1.1.1.1
contactpermit: NULL
contactdeny: NULL
fullname: NULL
cid_number: NULL
callingpres: NULL
mohinterpret: NULL
mohsuggest: NULL
hasvoicemail: NULL
subscribemwi: NULL
vmexten: NULL
rtpkeepalive: NULL
directrtpsetup: yes
dtlsenable: yes
dtlsverify: no
dtlsprivatekey: /etc/asterisk/keys/asterisk.pem
dtlssetup: actpass
dtlscertfile: /etc/asterisk/keys/asterisk.pem
dtlscafile: /etc/asterisk/keys/ca.crt
sippasswd: a84a4ddcda13d13c9573d5294047b6a2
rpid: NULL
domain: testers.com
sippasswd2: NULL
id: 8
name: 700
ipaddr: 1.1.1.1
port: 5060
regseconds: 1407323638
defaultuser: 700
fullcontact: sip:700 at 1.1.1.1:5060
regserver:
useragent:
lastms: 0
host: dynamic
type: friend
context: default
deny: 0.0.0.0/0.0.0.0
permit: 1.1.1.1
secret: NULL
md5secret: NULL
avpf: no
force_avp: NULL
icesupport: NULL
directmedia: NULL
encryption: NULL
nat: force_rport,comedia
callgroup: NULL
pickupgroup: NULL
language: NULL
disallow: NULL
allow: NULL
setvar: NULL
callerid: NULL
amaflags: NULL
videosupport: yes
maxcallbitrate: NULL
mailbox: NULL
regexten: NULL
fromdomain: testers.com
fromuser: 700
qualify: NULL
defaultip: NULL
outboundproxy: 1.1.1.1
contactpermit: NULL
contactdeny: NULL
fullname: NULL
cid_number: NULL
callingpres: NULL
mohinterpret: NULL
mohsuggest: NULL
hasvoicemail: NULL
subscribemwi: NULL
vmexten: NULL
rtpkeepalive: NULL
directrtpsetup: NULL
dtlsenable: NULL
dtlsverify: NULL
dtlsprivatekey: NULL
dtlssetup: NULL
dtlscertfile: NULL
dtlscafile: NULL
sippasswd: 2ef16ba6cda5dcd34088f4127b90048b
rpid: NULL
domain: testers.com
sippasswd2: NULL
cheers,
Olli
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.digium.com/pipermail/asterisk-users/attachments/20140806/01fd40d1/attachment.html>
Joshua Colp
2014-Aug-06 12:26 UTC
[asterisk-users] From and To headers contain same account in INVITEs
Olli Heiskanen wrote:> Hello,Kia ora,> 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. > > Can you guys tell me what might be causing this? I have 660 at testers.com > <mailto:660 at testers.com> as a websocket client and 700 at testers.com > <mailto:700 at testers.com> (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.Your configuration has "fromuser" set which explicitly sets the user portion of the From header to what you specify. This is commonly used for ITSPs as they use that to determine who you are trying to authenticate as. If you require this to be set then caller id information has to be transported in a different manner (RPID or PAI). Cheers, -- Joshua Colp Digium, Inc. | Senior Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: www.digium.com & www.asterisk.org