Avaya VM Pro modules in Freepbx

try

.
same => n,Playback(custom/${_RGPREFIX}c)
.

thank you , but tried that before and came back as empty…
– Executing [19146629003@from-pstn:2] Playback(“SIP/callcentric10-0000015f”, “custom/c”) in new stack

some lines of logs…to get an idea

Line 6194: – Executing [19146629003@ext-did:23] Macro(“SIP/callcentric10-0000015f”, “prepend-cid,2803”) in new stack
Line 6201: – Executing [s@macro-prepend-cid:5] Set(“SIP/callcentric10-0000015f”, “_RGPREFIX=2803”) in new stack
Line 6205: – Executing [s@macro-prepend-cid:6] Set(“SIP/callcentric10-0000015f”, “CALLERID(name)=2803#”) in new stack
Line 6290: AppData: prepend-cid,2803
Line 6395: Value: 2803
Line 6481: AppData: _RGPREFIX=2803
Line 6502: Value: 2803
Line 6545: AppData: CALLERID(name)=2803#
Line 6555: CallerIDName: 2803#
Line 6575: CallerIDName: 2803#
Line 6596: CallerIDName: 2803#
Line 6714: AppData: prepend-cid,2803
Line 6819: Value: 2803
Line 6905: AppData: _RGPREFIX=2803
Line 6926: Value: 2803
Line 6969: AppData: CALLERID(name)=2803#

and what I need is the 2803 (in this example) as it’s the destination name…

hope it makes sense

I’m wondering

[2020-11-26 17:39:46] DEBUG[24272]: manager.c:6118 match_filter: Examining AMI event:
Event: Newexten
Privilege: dialplan,all
Channel: SIP/callcentric10-0000015f
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9149145555
CallerIDName: #
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: macro-prepend-cid
Exten: s
Priority: 5
Uniqueid: 1606412385.427
Linkedid: 1606412385.427
Extension: s
Application: Set
AppData: _RGPREFIX=2803

[2020-11-26 17:39:46] DEBUG[24272]: manager.c:6118 match_filter: Examining AMI event:
Event: VarSet
Privilege: dialplan,all
Channel: SIP/callcentric10-0000015f
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9149145555
CallerIDName: #
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: macro-prepend-cid
Exten: s
Priority: 5
Uniqueid: 1606412385.427
Linkedid: 1606412385.427
Variable: _RGPREFIX
Value: 2803

If _RGPREFIX became empty (can’t thing why) then ${CALLERID(name):4} should work.

But I strip out the CallerID name and replace it with a #
so I only see the CID (2803) and #

add a DumpChan() to your context

Dumping Info For Channel: SIP/callcentric19-00000165:

Info:
Name= SIP/callcentric19-00000165
Type= SIP
UniqueID= 1606414001.433
LinkedID= 1606414001.433
CallerIDNum= 9149145555
CallerIDName= 2803#
ConnectedLineIDNum= (N/A)
ConnectedLineIDName=(N/A)
DNIDDigits= (N/A)
RDNIS= (N/A)
Parkinglot= default
Language= en
State= Ring (4)
Rings= 0
NativeFormat= (ulaw)
WriteFormat= ulaw
ReadFormat= ulaw
RawWriteFormat= ulaw
RawReadFormat= ulaw
WriteTranscode= No
ReadTranscode= No
1stFileDescriptor= 47
Framesin= 0
Framesout= 0
TimetoHangup= 0
ElapsedTime= 0h0m0s
BridgeID= (Not bridged)
Context= from-pstn-custom
Extension= s
Priority= 1
CallGroup=
PickupGroup=
Application= DumpChan
Data= (Empty)
Blocking_in= (Not Blocking)

Variables:
ARGC=0
AGISTATUS=SUCCESS
CRM_LINKEDID=1606414001.433
CRM_SOURCE=9149145555
CRM_DIRECTION=INBOUND
MACRO_DEPTH=0
RGPREFIX=2803
lookupcid=#
SUPERFECTA_OLD=Statlinx
SUPERFECTA_NEW=#
CIDSFSCHEME=YmFzZV9TdGF0bGlueA==
CALLINGNUMPRES_SV=allowed_not_screened
CALLINGNAMEPRES_SV=allowed_not_screened
REVERSAL_REJECT=FALSE
MOHCLASS=
GOSUB_RETVAL=
CALLED_BLACKLIST=1
returnhere=1
FROM_DID=19149146666
FROMEXTEN=9149145555
REC_POLICY_MODE_SAVE=
MON_FMT=wav
TIMESTR=20201126-180641
YEAR=2020
MONTH=11
DAY=26
NOW=1606414001
REC_STATUS=INITIALIZED
SIPCALLID=fa0a0e5a-aab4-1239-60b6-0010e0690d2e
SIPDOMAIN=46.28.110.95
SIPURI=sip:[email protected]:5880

[2020-11-26 18:06:41] DEBUG[15021][C-00001715]: pbx.c:2933 pbx_extension_helper: Launching ‘Playback’
– Executing [s@from-pstn-custom:2] Playback(“SIP/callcentric19-00000165”, “custom/c”) in new stack
[2020-11-26 18:06:41] DEBUG[15021][C-00001715]: chan_sip.c:7461 sip_answer: SIP answering channel: SIP/callcentric19-00000165
[2020-11-26 18:06:41] DEBUG[15021][C-00001715]: res_rtp_asterisk.c:4097 ast_rtp_update_source: Setting the marker bit due to a source update
[2020-11-26 18:06:41] DEBUG[15021][C-00001715]: chan_sip.c:13585 add_sdp: ** Our capability: (ulaw) Video flag: True Text flag: True
[2020-11-26 18:06:41] DEBUG[15021][C-00001715]: chan_sip.c:13586 add_sdp: ** Our prefcodec: (nothing)
Audio is at 14376
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
[2020-11-26 18:06:41] DEBUG[15021][C-00001715]: chan_sip.c:13757 add_sdp: – Done with adding codecs to SDP
[2020-11-26 18:06:41] DEBUG[15021][C-00001715]: chan_sip.c:13782 add_sdp: Setting framing on incoming call: 20
[2020-11-26 18:06:41] DEBUG[15021][C-00001715]: chan_sip.c:13976 add_sdp: Done building SDP. Settling with this capability: (ulaw)

<— Reliably Transmitting (NAT) to 207.77.154.411:5080 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 204.11.192.171:5080;branch=z9hG4bK-ef74d44370301e9363723cca234123a8;received=207.77.154.411;rport=5080
From: “Statlinx” sip:[email protected];tag=r8vrmcejK01KF
To: sip:[email protected];tag=as714bf4a4
Call-ID: fa0a0e5a-aab4-1239-60b6-0010e0690d2e
CSeq: 28653208 INVITE
Server: FPBX-15.0.16.78(16.6.2)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:[email protected]:5160
Content-Type: application/sdp
Content-Length: 251

v=0
o=root 1705780862 1705780862 IN IP4 46.28.110.95
s=Asterisk PBX 16.6.2
c=IN IP4 46.28.110.95
t=0 0
m=audio 14376 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<------------>

and tried
same => n,Playback(custom/${RGPREFIX}c)
still empty

DumpChannel() lists the channel variables as you see CallerIDName=2803# remember variables are case sensitive.

yes but that is a comb of 2803 and # and I need 2803 only…
set in inbound route as CID
I’m confused

that’s what the :4 does , google asterisk substrings

I’m afraid not…
the CALLERID(name) being Mainlink
i get custom/linkc
same => n,Playback(custom/${CALLERID(name):4}c)

Does this help?
[2020-11-26 19:29:55] DEBUG[29065][C-0000171f]: pbx.c:2933 pbx_extension_helper: Launching ‘Macro’
– Executing [19146629003@ext-did:23] Macro(“SIP/callcentric19-0000016e”, “prepend-cid,2803”) in new stack
[2020-11-26 19:29:55] DEBUG[29065][C-0000171f]: pbx_variables.c:842 pbx_substitute_variables_helper_full: Expression result is ‘1’
[2020-11-26 19:29:55] DEBUG[29065][C-0000171f]: pbx.c:2933 pbx_extension_helper: Launching ‘GotoIf’
– Executing [s@macro-prepend-cid:1] GotoIf(“SIP/callcentric19-0000016e”, “1?REPCID”) in new stack
– Goto (macro-prepend-cid,s,5)
[2020-11-26 19:29:55] DEBUG[29065][C-0000171f]: app_macro.c:480 _macro_exec: Executed application: GotoIf
[2020-11-26 19:29:55] DEBUG[29065][C-0000171f]: pbx.c:2933 pbx_extension_helper: Launching ‘Set’
– Executing [s@macro-prepend-cid:5] Set(“SIP/callcentric19-0000016e”, “_RGPREFIX=2803”) in new stack
[2020-11-26 19:29:55] DEBUG[29065][C-0000171f]: app_macro.c:480 _macro_exec: Executed application: Set
[2020-11-26 19:29:55] DEBUG[29065][C-0000171f]: pbx_variables.c:772 pbx_substitute_variables_helper_full: Function CALLERID(name) result is ‘#’
[2020-11-26 19:29:55] DEBUG[29065][C-0000171f]: pbx.c:2933 pbx_extension_helper: Launching ‘Set’
– Executing [s@macro-prepend-cid:6] Set(“SIP/callcentric19-0000016e”, “CALLERID(name)=2803#”) in new stack
[2020-11-26 19:29:55] DEBUG[29065][C-0000171f]: app_macro.c:480 _macro_exec: Executed application: Set
[2020-11-26 19:29:55] DEBUG[29065][C-0000171f]: pbx.c:2933 pbx_extension_helper: Launching ‘Set’

Did I mention case sensitivity ? and I typo’d > ${CALLERID(name):4} should be > ${CALLERID(name):0:4}

Yes you did.
with the latest I see the initial part of Mainlink which is ‘Main’…
I can see in the logs Function CALLERID(name) result is ‘Mainlink’
and then this

– <SIP/callcentric10-00000170>AGI Script agi://127.0.0.1//var/www/html/admin/modules/superfecta/agi/superfecta.agi completed, returning 0
[2020-11-27 06:20:14] DEBUG[29127][C-000017c2]: pbx.c:2933 pbx_extension_helper: Launching ‘Set’
– Executing [19146629003@ext-did:21] Set(“SIP/callcentric10-00000170”, “CALLERID(name)=#”) in new stack
[2020-11-27 06:20:14] DEBUG[29127][C-000017c2]: pbx.c:2933 pbx_extension_helper: Launching ‘NoOp’
– Executing [19146629003@ext-did:22] NoOp(“SIP/callcentric10-00000170”, “CallerID Entry Point”) in new stack
[2020-11-27 06:20:14] DEBUG[29127][C-000017c2]: pbx.c:2933 pbx_extension_helper: Launching ‘Macro’
– Executing [19146629003@ext-did:23] Macro(“SIP/callcentric10-00000170”, “prepend-cid,2803”) in new stack
[2020-11-27 06:20:14] DEBUG[29127][C-000017c2]: pbx_variables.c:842 pbx_substitute_variables_helper_full: Expression result is ‘1’
[2020-11-27 06:20:14] DEBUG[29127][C-000017c2]: pbx.c:2933 pbx_extension_helper: Launching ‘GotoIf’
– Executing [s@macro-prepend-cid:1] GotoIf(“SIP/callcentric10-00000170”, “1?REPCID”) in new stack
– Goto (macro-prepend-cid,s,5)

GOT IT!!
now step 2…
Thank you!!!

now I need to call an IVR in the same way…
the ivr is called 2803closed
so I thought
${CALLERID(name):0:4}closed ?

1 Like

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