Accessing outbound channels

Hello, I’m having a hard time trying to access the outbound channel’s variables.

I have two PJSIP endpoints defined under pjsip.conf, very simple.

Call comes in from one endpoint, and goes to the second endpoint through my Asterisk box.

In the extensions.conf file I’m able to use the following line to get the inbound channel’s (source) IP address and port:

same => n,NoOp(=== Call coming from ${CHANNEL(pjsip,remote_addr)} ===)

However, I’m unable to get the same thing for the outbound channel.

Any thoughts as to where I should be looking to get this? Using Asterisk 20.2.1 on Centos 8.

Thank you.

What do you want to do with them?

There is a channel variable that gives the bridged channel, after it answers, which you can use with IMPORT (although dialplan will not have control at that point), or you can run the code in an answer subroutine, again after the call is answered. I’m not sure how easy it is to get this with AMI, before the call is answered; you may have to infer the outgoing channel.

There might be ways of doing by replacing Dial with Stasis and using ARI, but I don’t know enough about that.

Thank you David, I just need to set the outbound IP address and port number to a CDR variable. At the moment the CDR fields that I have show the following for the outbound leg:

PJSIP/123456789@provider_name

I’d like to have a separate field just showing the outbound SIP IP address and port.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.