[asterisk-bugs] [JIRA] (ASTERISK-24040) Retrieving source port of sip message in dialplan

Matt Jordan (JIRA) noreply at issues.asterisk.org
Mon Jul 14 08:12:57 CDT 2014


     [ https://issues.asterisk.org/jira/browse/ASTERISK-24040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Jordan updated ASTERISK-24040:
-----------------------------------

    Description: 
I need to route calls in the dialplan based on source ip and source port. Source ip can be retrieved with {{$\{CHANNEL(recvip)\}}} but there is no entry in CHANNEL var to retrieve the port (much to my amazement). Attached is a simple patch that appears to do the job for SIP channels: {{$\{CHANNEL(recvport)\}}}:

For 

{noformat}
exten => 1,n,NoOp(ip:port ${CHANNEL(recvip)}:${CHANNEL(recvport)})
{noformat}

a sip invite like:
{noformat}
<--- SIP read from UDP:10.0.3.175:5555 --->
INVITE sip:1 at 10.0.2.16 SIP/2.0
{noformat}

will result in:
{noformat}
-- Executing [1 at default:2] NoOp("SIP/tst-00000004", "ip:port 10.0.3.175:5555") in new stack
{noformat}



  was:
I need to route calls in the dialplan based on source ip and source port. Source ip can be retrieved with {{ ${CHANNEL(recvip)} }} but there is no entry in CHANNEL var to retrieve the port (much to my amazement). Attached is a simple patch that appears to do the job for SIP channels:{{ ${CHANNEL(recvport)} }}:

For 

{noformat}
exten => 1,n,NoOp(ip:port ${CHANNEL(recvip)}:${CHANNEL(recvport)})
{noformat}

a sip invite like:
{noformat}
<--- SIP read from UDP:10.0.3.175:5555 --->
INVITE sip:1 at 10.0.2.16 SIP/2.0
{noformat}

will result in:
{noformat}
-- Executing [1 at default:2] NoOp("SIP/tst-00000004", "ip:port 10.0.3.175:5555") in new stack
{noformat}




> Retrieving source port of sip message in dialplan
> -------------------------------------------------
>
>                 Key: ASTERISK-24040
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24040
>             Project: Asterisk
>          Issue Type: New Feature
>      Security Level: None
>          Components: Channels/chan_sip/NewFeature
>    Affects Versions: 11.10.2
>            Reporter: dtryba
>            Severity: Trivial
>
> I need to route calls in the dialplan based on source ip and source port. Source ip can be retrieved with {{$\{CHANNEL(recvip)\}}} but there is no entry in CHANNEL var to retrieve the port (much to my amazement). Attached is a simple patch that appears to do the job for SIP channels: {{$\{CHANNEL(recvport)\}}}:
> For 
> {noformat}
> exten => 1,n,NoOp(ip:port ${CHANNEL(recvip)}:${CHANNEL(recvport)})
> {noformat}
> a sip invite like:
> {noformat}
> <--- SIP read from UDP:10.0.3.175:5555 --->
> INVITE sip:1 at 10.0.2.16 SIP/2.0
> {noformat}
> will result in:
> {noformat}
> -- Executing [1 at default:2] NoOp("SIP/tst-00000004", "ip:port 10.0.3.175:5555") in new stack
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list