Add string to incoming number

I’ve a freepbx with 2 trunk I need to identify when a call came from first trunk or second in this way my users are can mange it correctly.

My phone today when receive a call show the number in formar “+39333xxxxx<+39333xxxxx>” my goal is when receive a call from first show “LIN1-+39333xxxxx” and for second “SUP-+393333xxxxx”.

I try wiht custom_extension.conf but not use it this is the conf

[custom-trunk-cid]
exten => s,1,NoOp(Entering custom context to modify CID)
exten => s,n,Set(TRUNK_NAME=${CUT(CHANNEL,-,1)})
exten => s,n,Set(TRUNK_LABEL=UNKNOWN)
exten => s,n,GotoIf($[“${TRUNK_NAME}” = “SIP/trunk1”]?trunk1)
exten => s,n,GotoIf($[“${TRUNK_NAME}” = “SIP/trunk2”]?trunk2)
exten => s,n,Goto(normal)
exten => s,n(trunk1),Set(TRUNK_LABEL=TRUNK_ONE)
exten => s,n,Goto(normal)
exten => s,n(trunk2),Set(TRUNK_LABEL=TRUNK_TWO)
exten => s,n,Goto(normal)
exten => s,n(normal),Set(CALLERID(all)=${CALLERID(num)}-${TRUNK_LABEL})
exten => s,n,Goto(from-trunk,${EXTEN},1)

My trunk is PJSIP

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