[OpenSIPS-Users] Replace From Field

Iulian Macare iulian.macare at gmail.com
Fri Mar 2 21:13:17 CET 2012


Hello

My setup is the following:


Serveral asterisk boxes (let's name them asteriskG) that register and
send calls to opensips that balance the outbound calls to other 3 x
asterisk servers (let's name them asteriskO) that  futher sends the
calls to my SIP ITSP. ( I have 3 ITSP , each one connected to a
asteriskO )

So by having this setup , I can balance the calls generated by
asteriskG to my 3 ITSP providers.


What I would like to do is to get rid of the 3 asteriskO server that I
use to connect to the ITSP and use MediaProxy for rtp relay.

In order to do this I must replace the from field that contains my
internal usernames&passwords that asteriskG connect to opensips with
the username&password that my ITSP require

I have tried doing this with uac_replace_from but I keep get SIP/2.0
403 Forbidden


What I have found is the following:

Let's say that asteriskG ( 192.168.20.66 ) connects to opensips (
192.168.4.250 ) with user 9000 and the user for ITSP ( 192.168.4.26 )
is 30

I tried the following: uac_replace_from("30","sip:30 at 192.168.4.250");
and the sip log is:

INVITE sip:05954543 at 192.168.4.26 SIP/2.0
Record-Route: <sip:192.168.4.250;lr=on;ftag=ca42eb7f;vsf=AAAAAAoAcAF5AxcDGAkYDAAGGwI1MA-->
Via: SIP/2.0/UDP 192.168.4.250;branch=z9hG4bK58a2.12e355c3.0
Via: SIP/2.0/UDP
192.168.20.66:26838;received=192.168.20.66;branch=z9hG4bK-d8754z-2f50b813447d8503-1---d8754z-;rport=26838
Max-Forwards: 69
Contact: <sip:9000 at 192.168.20.66:26838>
To: "05954543"<sip:05954543 at 192.168.4.250>
From: "30"<sip:30 at 192.168.4.250>;tag=ca42eb7f
Call-ID: OWNiODdiNTBiNTdiOWIxMDUxZDQwNzkwZTg4MjdjOGE.
CSeq: 4 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,
SUBSCRIBE, INFO
Content-Type: application/sdp
Proxy-Authorization: Digest
username="9000",realm="asterisk",nonce="2fe5b437",uri="sip:05954543 at 192.168.4.250",response="38d11bf7db043a643500a74dfb29b933",algorithm=MD5
Content-Length: 420


Sending to 192.168.4.250 : 5060 (NAT)
Using INVITE request as basis request -
OWNiODdiNTBiNTdiOWIxMDUxZDQwNzkwZTg4MjdjOGE.
Found user '30'
<--- Reliably Transmitting (NAT) to 192.168.4.250:5060 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP
192.168.4.250;branch=z9hG4bK58a2.12e355c3.0;received=192.168.4.250
Via: SIP/2.0/UDP
192.168.20.66:26838;received=192.168.20.66;branch=z9hG4bK-d8754z-2f50b813447d8503-1---d8754z-;rport=26838
From: "30"<sip:30 at 192.168.4.250>;tag=ca42eb7f
To: "05954543"<sip:05954543 at 192.168.4.250>;tag=as388b4f7b
Call-ID: OWNiODdiNTBiNTdiOWIxMDUxZDQwNzkwZTg4MjdjOGE.
CSeq: 4 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0




Why do I get forbidden ? why in Proxy-Authorization: Digest username
is still 9000 ?

If I set user 30 on AsteriskG ( 192.168.20.66 ) works fine ....I use
opensips 1.6.4



More information about the Users mailing list