How to use caller ID name in dialplan?

I’m trying to edit my dialplan so that BOTH the incoming caller’s number AND name are sent as an MQTT message. At the moment no matter whether I use CALLERID(name) or CALLERID(all), I just get the phone number, HOWEVER…Asterisk itself is well aware of the callerID name, but I think it’s set many commands AFTER the mosquitto trysystem is done.

[2020-04-29 21:37:43] VERBOSE[26210][C-0000001b] pbx.c: Executing [1@disa:9] Set("SIP/SIPGATE-00000017", "CALLERID(all)="Dave Mobile"") in new stack

[from-trunk]
exten => _X.,1,trysystem(mosquitto_pub -h 192.168.2.110 -t 'calls/in/${EXTEN}' -m '${CALLERID(num)}' )
exten => _X.,n,trysystem(mosquitto_pub -h 192.168.2.110 -t 'calls/name≈/${EXTEN}' -m '${CALLERID(name)}' )
exten => _X.,n,Goto(from-pstn,${EXTEN},1)

thanks for any insights! :slight_smile:

You could try adding a DumpChan() to see what other variable information is available at time. For example:

[from-trunk]
exten => _X.,1,trysystem(mosquitto_pub -h 192.168.2.110 -t 'calls/in/${EXTEN}' -m '${CALLERID(num)}' )
exten => _X.,n,trysystem(mosquitto_pub -h 192.168.2.110 -t 'calls/name≈/${EXTEN}' -m '${CALLERID(name)}' )
exten => _X.,n,DumpChan()
exten => _X.,n,Goto(from-pstn,${EXTEN},1)

You should see a list of available information in the acli during a test call that could lead to some clues.

Hey there,

Seems like we are having the same issue with different approaches… I made a post about it a few days back (Set CID unable to change/add a custom name) still haven’t got a resolution either.

Luis

have you guys tried setting “Only Use Last CID Prepend” in advanced settings to “No”?

Hi PitzKey,

I did on my for my testing on my other post but didn’t do anything.

Luis

I think this is the issue

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