Outbound Number in Stasis

Hello All,

I am generating outbound calls using call file, which is running connecting to an outbound number and comes to a context which has stasis application.

I want to how can I capture the outbound number in my stasis application.

Call file sample

Channel: PJSIP/07738345865@tcl_sip
MaxRetries: 2
RetryTime: 60
WaitTime: 30
Context: tcl-in
Extension: 4825271
Priority: 1
Archive: yes

My dialplan
exten => 1534571,1,Answer()
same => n,Set(${CDR(accountcode)}=‘bot’)
;same => n,Set(FileName=${EXTEN})
same => n,Set(FileName=${UNIQUEID})
same => n,Set(DialedNum=${DIALEDPEERNUMBER})
same => n,MixMonitor(${FileName}.wav)
same => n,Stasis(stasis-app)

appreciate and thanks in advance.

Chetan Jha

Two options immediately come to mind:

  1. Pass it as an argument to your Stasis application in the Stasis dialplan application execution[1]
  2. Retrieve the dialplan variable using the variables functionality[2]

[1] Stasis - Asterisk Documentation
[2] Channels - Asterisk Documentation


Thanks for a quick response,

But when I pull Channel details I get the caller ID number which is set as number and name which is not the dialed number.

for inbound there is no issue.


I didn’t mention pulling channel details at all. I said to either pass it as an argument, or retrieve the dialplan variable. If you have access to the information in the dialplan (I assume DialedNum dialplan variable is it), then you can get it.

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