[OpenSIPS-Users] Opensip as transaprent inbound proxy for asterisk

Bakko asannucci at gmail.com
Mon Oct 14 21:29:58 CEST 2013


Hello,

I'm use this procedure to know original IP (long way):

first define a context on opensips trunk configurated on Asterisk., then 
I use this dialplan block:

[opensip]
exten => _X.,1,Set(uri=${CHANNEL(uri)})
same => n,Set(uri2=${CHANNEL(from)})
same => n,Set(uri=${CUT(uri,@,2)})
same => n,Set(uri=${CUT(uri,:,1)})
same => n,Gotoif($["${uri}" = ""]?fromuri)
same => n,Gotoif($[${DB_EXISTS(ip/${uri})} = 0]?block)
same => n,Goto(${DB(ip/${uri})},${EXTEN},1)
same => n,Hangup
same => n(fromuri),Set(uri=${CUT(uri2,@,2)})
same => n,Set(uri=${CUT(uri,:,1)})
same => n,Gotoif($[${DB_EXISTS(ip/${uri})} = 0]?block)
same => n,Goto(${DB(ip/${uri})},${EXTEN},1)
same => n,Hangup
same => n(block),NoOP(bloqueo de IP)
same => n,Hangup

IF the IP is not present on contact header is present on from header. 
Then I created family key on internal Asterisk database with this sintax:

IP 1.2.3.4 name

Asterisk check if The IP is present on database and if true send the 
call to context "name".

 From there you can use the dialplan you want.

Regards.



El 14/10/2013 13:02, bluerain escribió:
> thx for the suggestion, I don't think asterisk reads the IP from any of the
> header or in any part of SIP message.  I think asterisk read the IP from the
> IP at the network layer.  anyhow, if you like you can read my reply to Mike.
>
> Thx again.  Have you ever encounter the usr_loc module that stop updating
> the DB location table after few hours from initial boot?
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Opensip-as-transaprent-inbound-proxy-for-asterisk-tp7588047p7588083.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>




More information about the Users mailing list