[asterisk-dev] chan_sip: Getting the source domain

Bruno Rocha bruno at 3gnt.net
Wed Mar 15 08:44:46 MST 2006


Bruno Rocha wrote:
> Hi!
> 
> I want that asterisk shows to the phone the source domain from a call,
> instead of his own ip/domain.
> 
> For example, if "alice at domainA" calls "bob at mydomain", I want that Bob's
> phone shows a call from "alice at domainA", not "alice at mydomain".
> 
> In sip.conf I've tryed sendrpid = yes/no and trustrpid = yes/no, but I
> was unable to notice any change in the SIP "From:" field.
> 
> Looking at chan_sip.c code (very superficially) seems like build_rpid()
> is not getting the right fromdomain...
> 
> Or maybe I'm just missing some config option...
> 
> Regards,


Some extra debug:


=====
Incoming INVITE from external domain
=====
INVITE sip:123 at my.domain.net SIP/2.0
Via: SIP/2.0/UDP 81.92.x.x:5060;branch=z9hG4bK0e3883e6;rport
From: "Bruno Rocha" <sip:someone at external.domain.net>;tag=as4069c090
To: <sip:123 at my.domain.net>
Contact: <sip:someone at 81.92.x.x>
Call-ID: 3739e70d2b46010e36e43af74c5e854c at external.domain.net
CSeq: 102 INVITE
User-Agent: External PBX
Max-Forwards: 70
Date: Wed, 15 Mar 2006 12:15:51 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
Content-Length: 358


SIP/2.0 100 Trying
Via: SIP/2.0/UDP 
81.92.x.x:5060;branch=z9hG4bK0e3883e6;received=81.92.x.x;rport=5060
From: "Bruno Rocha" <sip:someone at external.domain.net>;tag=as4069c090
To: <sip:123 at my.domain.net>
Call-ID: 3739e70d2b46010e36e43af74c5e854c at external.domain.net
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:123 at 193.227.y.y>
Content-Length: 0


=====
Call enters in Asterisk extensions logic

[from-sip]
exten => 123,1,NoOp(New Call: for domain: <${SIPDOMAIN}> 
from=<${SIPCHANINFO(from)}>)
exten => 123,n,Dial(SIP/bruno)
exten => 123,n,Hangup
exten =>   h,1,NoOp(End Call: for domain: <${SIPDOMAIN}> 
from=<${SIPCHANINFO(from)}>)
=====

-- Executing NoOp("SIP/external.domain.net-086de308", "New Call: for 
domain: <my.domain.net> from=<sip:someone at external.domain.net>") in new 
stack
-- Executing Dial("SIP/external.domain.net-086de308", "SIP/bruno") in 
new stack 



=====
The local user is called, but the "From" field is wrong!
It contains the local ip, or the local domain if "fromdomain" is set in 
sip.conf
=====
INVITE sip:bruno_my_domain_net at 10.10.10.103 SIP/2.0
Via: SIP/2.0/UDP 193.227.y.y:5060;branch=z9hG4bK4c9da8a9;rport
From: "Bruno Rocha" <sip:someone at 193.227.y.y>;tag=as20e3cd2e
To: <sip:bruno_my_domain_net at 10.10.10.103>
Contact: <sip:someone at 193.227.y.y>
Call-ID: 7e85fd5a0d9157b17ae32ed054b919af at 193.227.y.y
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: "Bruno Rocha" 
<sip:someone at 193.227.y.y>;privacy=off;screen=no
Date: Wed, 15 Mar 2006 12:19:21 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
Content-Length: 391


Any solution to correct the "From:" field to the original domain?

Regards,
-- 
Bruno Rocha



More information about the asterisk-dev mailing list