Why is the prefix “CID:” added?
Can this prefix be removed?
7139 [2023-09-20 17:34:47] VERBOSE[6547][C-000000b7] pbx.c: Executing [s@macro-dialout-trunk:24] ExecIf("PJSIP/9272-00000193", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)Мобильный)") in new stack
[macro-dialout-trunk]
include => macro-dialout-trunk-custom
exten => s,1,Set(DIAL_TRUNK=${ARG1})
exten => s,n,ExecIf($["${DIRECTION}" = "INBOUND"]?Set(DIAL_OPTIONS=${STRREPLACE(DIAL_OPTIONS,T)}))
exten => s,n,GosubIf($[$["${ARG3}" != ""] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != "NOPASSWD"]]?sub-pincheck,s,1())
exten => s,n,ExecIf($["${INTRACOMPANYROUTE}" = "YES" & ${DB_EXISTS(AMPUSER/${AMPUSER}/cidnum)} & "${AMPUSER}" != "${DB(AMPUSER/${AMPUSER}/cidnum)}"]?Set(CALLERID(num)=${DB(AMPUSER/${AMPUSER}/cidnum)}))
exten => s,n,GotoIf($["x${OUTDISABLE_${DIAL_TRUNK}}" = "xon"]?disabletrunk,1)
exten => s,n,Set(DIAL_NUMBER=${ARG2})
exten => s,n,Set(DIAL_TRUNK_OPTIONS=${DIAL_OPTIONS})
exten => s,n,Set(OUTBOUND_GROUP=OUT_${DIAL_TRUNK})
exten => s,n,Set(DIAL_TRUNK_OPTIONS=${IF($["${DB_EXISTS(TRUNK/${DIAL_TRUNK}/dialopts)}" = "1"]?${DB_RESULT}:${TRUNK_OPTIONS})})
exten => s,n,GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}" = ""]?nomax)
exten => s,n,GotoIf($[ ${GROUP_COUNT(OUT_${DIAL_TRUNK})} >= ${OUTMAXCHANS_${DIAL_TRUNK}} ]?chanfull)
exten => s,n(nomax),GotoIf($["${INTRACOMPANYROUTE}" = "YES"]?skipoutcid)
exten => s,n,Macro(outbound-callerid,${DIAL_TRUNK})
exten => s,n(skipoutcid),GosubIf($["${PREFIX_TRUNK_${DIAL_TRUNK}}" != ""]?sub-flp-${DIAL_TRUNK},s,1())
exten => s,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER})
exten => s,n,Set(custom=${CUT(OUT_${DIAL_TRUNK},:,1)})
exten => s,n,ExecIf($["${MOHCLASS}"!="default" & "${MOHCLASS}"!="" & "${FORCE_CONFIRM}"="" ]?Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}))
exten => s,n,ExecIf($["${FORCE_CONFIRM}"!="" ]?Set(DIAL_TRUNK_OPTIONS=${DIAL_TRUNK_OPTIONS}M(confirm)))
exten => s,n,ExecIf($[${DB_EXISTS(allowlist/autoadd/${ROUTEID})}]?AGI(allowlist-autoadd.agi,))
exten => s,n(gocall),Macro(dialout-trunk-predial-hook,)
exten => s,n,GotoIf($["${PREDIAL_HOOK_RET}" = "BYPASS"]?bypass,1)
exten => s,n,ExecIf($["${DB(AMPUSER/${AMPUSER}/cidname)}" != ""]?Set(CONNECTEDLINE(num,i)=${DIAL_NUMBER}))
exten => s,n,ExecIf($[$["${DB(AMPUSER/${AMPUSER}/cidname)}" != ""] & $["${CALLERID(name)}"!="hidden"]]?Set(CONNECTEDLINE(name,i)=CID:${CALLERID(number)}))
exten => s,n,ExecIf($[$["${DB(AMPUSER/${AMPUSER}/cidname)}" != ""] & $["${CALLERID(name)}"="hidden"]]?Set(CONNECTEDLINE(name,i)=CID:(Hidden)${CALLERID(number)}))
exten => s,n,GotoIf($["${custom}" = "AMP"]?customtrunk)
exten => s,n,ExecIf($["${DIRECTION}" = "INBOUND"]?Set(DIAL_TRUNK_OPTIONS=${STRREPLACE(DIAL_TRUNK_OPTIONS,T)}))
exten => s,n,Set(HASH(__SIPHEADERS,Alert-Info)=unset)
exten => s,n,Dial(${OUT_${DIAL_TRUNK}}/${OUTNUM}${OUT_${DIAL_TRUNK}_SUFFIX},${TRUNK_RING_TIMER},${DIAL_TRUNK_OPTIONS}b(func-apply-sipheaders^s^1,(${DIAL_TRUNK}))U(sub-send-obroute-email^${DIAL_NUMBER}^${MACRO_EXTEN}^${DIAL_TRUNK}^${NOW}^${CALLERID(name)}^${CALLERID(number)}))
exten => s,n,Noop(Dial failed for some reason with DIALSTATUS = ${DIALSTATUS} and HANGUPCAUSE = ${HANGUPCAUSE})
exten => s,n,GotoIf($["${ARG4}" = "on"]?continue,1:s-${DIALSTATUS},1)
exten => s,n(customtrunk),Set(pre_num=${CUT(OUT_${DIAL_TRUNK},$,1)})
exten => s,n,Set(the_num=${CUT(OUT_${DIAL_TRUNK},$,2)})
exten => s,n,Set(post_num=${CUT(OUT_${DIAL_TRUNK},$,3)})
exten => s,n,GotoIf($["${the_num}" = "OUTNUM"]?outnum:skipoutnum)
exten => s,n(outnum),Set(the_num=${OUTNUM})
exten => s,n(skipoutnum),Dial(${pre_num:4}${the_num}${post_num},${TRUNK_RING_TIMER},${DIAL_TRUNK_OPTIONS})
exten => s,n,Noop(Dial failed for some reason with DIALSTATUS = ${DIALSTATUS} and HANGUPCAUSE = ${HANGUPCAUSE})
exten => s,n,GotoIf($["${ARG4}" = "on"]?continue,1:s-${DIALSTATUS},1)
exten => s,n(chanfull),Noop(max channels used up)
how can I fix it, I can’t understand or find information
Hi @fastboot ,
Search this setting in the settings → advanced settings tab: Display CallerID on Calling Phone and set it to No.
Thank you,
Daniel Friedman
Trixton LTD.
The problem is that PBX adds the prefix “CID:” even if I try to turn it off with asterisk code
It’s bad that I don’t understand this code and do it using the poke method
Hi @fastboot,
First,
Set this setting Display CallerID on Calling Phone to No.
Second,
is this an inbound or an outbound call? who is setting the PAI header?
Do you use an ATA with FXO ?
Thank you,
Daniel Friedman
Trixton LTD.
Hello @fastboot,
Please answer if you set this setting to no.
Display CallerID on Calling Phone
In the advanced settings tab.
Thank you,
Daniel Friedman
Trixton LTD.
I did not find such settings.
one way or another, asterisk (freepbx) sends information in the SIP packet with the already changed P-asserted-identity prefix “CID:…”
I figured out that asterisk does this, but I don’t know how to fix or change it
Hi @fastboot,
Again,
Go to the settings tab, then advanced settings,
find this setting Display CallerID on Calling Phone
and set it to No
Thank you,
Daniel Friedman
Trixton LTD.
Thanks ![]()
![]()
thank you, this actually removes the CallerID text…
Maybe I didn’t describe correctly what I wanted to get, but thanks for that!
I just wanted to remove the word prefix “CID:” because outgoing routes have specific names for number patterns. Thank you.
I apologize for the screenshots, I used a computer at a company)
hello @fastboot,
I am glad that I managed to solve your problem.
Let me know if you need anything else.
Thank you,
Daniel Friedman
Trixton LTD.
now displays outgoing number
previously showed Route CID for example
CID:PMR 1198
now it shows like this
1198
example:
P-Asserted-Identity: "PMR" <sip:[email protected]>
What happened before that
P-Asserted-Identity: "CID:PMR" <sip:[email protected]>
What is at the moment: Display CallerID on Calling Phone
P-Asserted-Identity: <sip:[email protected]>
At the moment there are no prefixes “CID:PMR” instead, just the number 1198 (this is for trunks only - outbound route name CID)
Hello @fastboot,
You can set the outbound route as an intra company route and then the caller id name and number will pass out to the trunk.
Thank you,
Daniel Friedman
Trixton LTD.
hello @fastboot.
your extension is sending the PAI (P-Asserted-Identity) header to your trunk. You can disable it by replacing the RPID field in the extension setting to RPID or none and test again.
If you need a specific PAI header you will have to set the RPID manually with a helper context.
Thank you,
Daniel Friedman
Trixton LTD.
Thank you very much, it turns out I no longer need to solve this problem. Thank you for your help!
thank you again so much for your help!
Best regards,
hello @fastboot,
I am glad you solved your problem, but I did not understand what you did.
Can you elaborate more?
Thank you,
Daniel Friedman
Trixton LTD.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.






















