Freepbx : need to get alphabetical CID on inbound calls

Dear all.

I’m using Freepbx 13.0.167 on Asterisk Ver. 11.22.0.

I’m using my asterisk as an extension of another PABX.
This second asterisk sends an alpha-numerical CallerID, something like ISI:0472424563 or PLU:0514121245

In the PEERS settings, I put trustrpid=yes (“yes” means that your system will look at the Remote Party ID header for the Caller ID on received calls instead of the from: field of the incoming call. If you aren’t getting Caller ID for incoming calls).

Times conditions differs depending on kind of inbound call… Means that time condition is different if it is “ISI” or “PLU”.

How can I manage this with Freepbx ?

Edit:
johnkiniston gave me this way:

Test the caller ID and act accordingly.

ExecIf($["${CALLERID(NAME):0:3}" = “PLU”]?Playback(tt-monkeys))
ExecIf($["${CALLERID(NAME):0:3}" = “ISI”]?Playback(tt-weasels))

My question is : how do I enter this in the Web interface ?

Regards,
Laurent.

I saw your post on the official forum asterisk, to make this change you need to change the entry route in FreePBX, you need to check this route of entry in the file generated by FreePBX that is /etc/asterisk/extensions_additional.conf and take this code for /etc/asterisk/extensions_freepbx_override.conf and making changes

Hi Jerson.

Great to read you.
Because I’m still aprentice in FreeBBX, what do you mean by you need to change the entry route in FreePBX ?

Regards,
Laurent

I meant to include the code you mentioned is to change the code generated by FreePBX GUI interface that is in the / etc / asterisk / extensions_additional.con for example:

/etc/asterisk/additional_extensions.conf
[ext-did-0002]

exten => 3737,1,Answer()
exten => 3737,n,Set(__FROM_DID=${EXTEN})
exten => 3737,n,Wait(1)
exten => 3737,n,Playback(introducao)
exten => 3737,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 3737,n,Gosub(app-blacklist-check,s,1())
exten => 3737,n,Set(CDR(did)=${FROM_DID})
exten => 3737,n,ExecIf($[ “${CALLERID(name)}” = “” ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 3737,n,Set(CHANNEL(musicclass)=default)
exten => 3737,n,Set(__MOHCLASS=default)
exten => 3737,n,GotoIf($["${__REVERSAL_REJECT}"=“TRUE” & “${CHANNEL(reversecharge)}”=“1” ]?macro-hangupcall)
exten => 3737,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 3737,n,Set(CALLERPRES()=allowed_not_screened)
exten => 3737,n(dest-ext),Goto(timeconditions,1,1)

/etc/asterisk/extensions_override_freepbx.conf
[ext-did-0002]

exten => 3737,1,Answer()
exten => 3737,n,Set(__FROM_DID=${EXTEN})
exten => 3737,n,Wait(1)
exten => 3737,n,Playback(introducao)
exten => 3737,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 3737,n,Gosub(app-blacklist-check,s,1())
exten => 3737,n,Set(CDR(did)=${FROM_DID})
;Test the caller ID and act accordingly.
exten => 3737,n,ExecIf($["${CALLERID(name):0:3}" = “PLU”]?Playback(tt-monkeys))
exten => 3737,n,ExecIf($["${CALLERID(name):0:3}" = “ISI”]?Playback(tt-weasels))
exten => 3737,n,Set(CHANNEL(musicclass)=default)
exten => 3737,n,Set(__MOHCLASS=default)
exten => 3737,n,GotoIf($["${__REVERSAL_REJECT}"=“TRUE” & “${CHANNEL(reversecharge)}”=“1” ]?macro-hangupcall)
exten => 3737,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 3737,n,Set(CALLERPRES()=allowed_not_screened)
exten => 3737,n(dest-ext),Goto(timeconditions,1,1)

… !
I was not aware that we can do this by overriding configrations files…

One more question… Should I change only a section like [ext-did-0002] or all the code into the conf file ?

Br,
Laurent.

It works !
First, I can get rid of some inbound calls depending on caller ID, and secondly I will be able to create my owns stuff !

Thanks you very much for this tip.

Regards,
Laurent.

1 Like