Dial command who picked up

I have a context which is a custom ring group which uses the Dial() applications with multiple numbers dialed at the same time (separated by &). It has a U() option to run a sub routine, which calls out via CURL to a web server script to list calls in a database.

This is fine when there is only one number to dial per Dial() command, I can just specify an argument, but I want to be able to pass the extension number of the person who answered the call. Does anyone know of a way of passing this as an argument to the subroutine?

I have tried using ${EXTEN} but this just passes ‘s’.

Any ideas?


${EXTEN} holds the extension of the context so if you are using ‘s’ in your context it will be passed correctly, so if I understand you need to know the device that answered the call, I’m not sure if ${DIALEDPEERNAME} will hep here

As navaismo says, you want the device name not the extension. All the called numbers have the same Asterisk extension.

DIALEDPEERNAME is set before the callee GOSUB is run, so should be valid in this context.

So I got my issue sorted in the end for anyone who is interested.

I couldn’t get either of the DIALEDPEERNAME / DIALEDPEERNUM variables to work.

However I passed the asterisk channel name to the server which contains the extension number of the user who answered the call and just used the server side script to extract the extension number.

Thanks for those who helped out :slight_smile:

1 Like