[SR-Users] Problem with to: header

julian arsanches guandulito.com at gmail.com
Mon Sep 23 19:09:56 CEST 2013


Can someone advise me on how to change the to header to show the host that
we are sending the call to an not the servers ip.

I am using dispatcher on my setup .

i am getting this


U 2013/09/23 12:57:54.576312 10.0.1.206:5060 -> 2.2.2.2:5060
INVITE sip:+42123333235 at 2.2.2.2:5060 SIP/2.0.
Record-Route: <sip:1.1.1.1;lr=on;ftag=as1f3df8b3>.
Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bKb29d.7399c2b3.0.
Via: SIP/2.0/UDP  1.1.1.5:5060;branch=z9hG4bK42a1ecaf;rport=5060.
Max-Forwards: 16.
From:<sip:unavailable at 1.1.1.1>.
To: <sip:+4212333323 at 1.1.1.1>.
Contact: <sip:anonymous at 1.1.1.5:5060>.
Call-ID: 0df8db614d45bae27035443c35166ba6 at 1.1.1.5:5060.
CSeq: 102 INVITE.
User-Agent: Asterisk PBX 1.8.15-cert2.
Date: Mon, 23 Sep 2013 16:58:25 GMT.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH.
Supported: replaces, timer.
Cisco-Guid: 7128745-3588944267-852064 at msc1
Content-Type: application/sdp.
Content-Length: 288.
.
v=0.
o=root 1760548326 1760548326 IN IP4 54.236.97.30.
s=Asterisk PBX 1.8.15-cert2.
c=IN IP4 1.1.1.5.
t=0 0.
m=audio 39794 RTP/AVP 0 18 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:18 G729/8000.
a=fmtp:18 annexb=no.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=ptime:20.
a=sendrecv.

I need to  sent header to a carrier like this

To: <sip:+4212333323 at 2.2.2.2>  instead of 1.1.1.1.

i am proxing calls from asterisk to a main carrier.
Please help.

here is my config.



if (starts_with("$var(o)","anonymous")) {

ds_select_domain("$var(z)", "4");#carrier dynamic


xlog("here is anonymous call <$var(o)>77777\n");


$var(n)=$(tU{s.substr,3,0});


remove_hf("From");
remove_hf("P-Asserted-Identity");
remove_hf("Privacy");

insert_hf("From:<sip:unavailable at 1.1.1.1.1>\r\n", "From");
$tU=$var(n);
xlog("out header CHECK ANONYMOUS BEFORE to $tu--$td - contact pai+++
<<$ct>>++ from_uri=$fu;<$tU---=$var(n)> to_uri=$tu; }pai<$ai>intid=$fU;
type_call=$si; dst_ip=$ru; carriercode=$var(z);callmode=$var(out)");

if(!t_relay()){;
sl_reply_error();
exit;
};
##ENDANONYMOUS

exit;

}

Again thanks  a lot for any help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130923/292a7c45/attachment.html>


More information about the sr-users mailing list