Look Multiple CallerID in a pinset on Incoming Route

Hi All!,

I have an incoming route that match a DID and multiple Caller ID’s. I have done that following a tutorial that takes the code generated by FreePBX on the extensions_additional.conf file and copying it to extensions_custom.conf using the context name ( [ext-did-0001] ) followed by “-custom” ( [ext-did-0001-custom] ). This is the code I repeat for every Caller ID:

exten => 10000/70189327,1,Set(__FROM_DID=${EXTEN}) exten => 10000/70189327,n,Gosub(app-blacklist-check,s,1) exten => 10000/70189327,n,Set(CHANNEL(language)=es) exten => 10000/70189327,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)})) exten => 10000/70189327,n,Set(__CALLINGPRES_SV=${CALLERPRES()}) exten => 10000/70189327,n,Set(CALLERPRES()=allowed_not_screened) exten => 10000/70189327,n(dest-ext),Goto(disa,5,1)

It works perfect, but I was wondering if there is a way to make asterisk (by using custom code) look for those Caller ID’s into a pinset, so that way a common user could add a new Caller ID (on the pinset) without modifying asterisk code just using FreePBX’s GUI. ??

Thank you in advance

FreePBX peer support is provided at http://community.freepbx.org/

You could use the SHELL() function to set the content of the pinset file as an Asterisk’s variable. For example

[custom-cid]
exten=>_7.,1,Noop()
same=>n,Set(CID=${SHELL(cat /var/www/cid.conf)})
same=>n,Set(CALLERID(num)=${CID})
same=>n,Set(TRUNK=${SHELL(cat /var/www/trunk.conf)})
same=>n,Dial(SIP/${EXTEN:1}@${TRUNK},25)
same=>n,hangup()

In your case as you will have multiples values and lines on your file , you will need to loop on the file and will be more complex

1 Like

Hi @ambiorixg12 thank you very much!

I was looking for something like what you suggest! I will try it.

Regards!

1 Like