Skip to main content

Feature Code pulls back \Declined"on Cisco phone"""

Posted by chickenlip on Tue, 02/21/2012

I'm testing out Third Lane MTE and in order to provide proof of concept to the powers that be, need to be able to perform the following: intercom and fax. Haven't touched fax yet (will ask about that in a future post if I'm still having issues), but am having an issue with the intercom.

Here's what I've done:

Created feature code (500) for tl-page and picked the two extensions I have configured. (BTW, extensions can call one another and call out to the world and receive phone calls on their DID's).

I have configured the phones Cisco's to accept 5xx in their dialplan string.

When I try calling the 500 feature code, I get a "declined" message coming back to me. Looking at the asterisk running debug log, I see the following (see attachment for complete log)

[2012-02-21 19:20:28] WARNING[28293]: pbx.c:3846 pbx_substitute_variables_helper_full: Error in extension logic (missing '}')
[2012-02-21 19:20:28] WARNING[28293]: ast_expr2.fl:468 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected $end, expecting '-' or '!' or '(' or ''; Input:
2 = 0|
^
[2012-02-21 19:20:28] WARNING[28293]: ast_expr2.fl:472 ast_yyerror: If you have questions, please refer to https://wiki.asterisk.org/wiki/display/AST/Channel+Variables

Not sure if I'm going about this the wrong way, so any suggestions would be appreciated.

Thanks!!


Submitted by eeman on Wed, 02/22/2012 Permalink

you appear to be running an older version of thirdlane... lines 7 and 8 of macro-tl-page are now

exten => s,n,NoOp(TESTCHAN is "${TESTCHAN}" and and AVAILSTATUS is "${AVAILSTATUS}")
exten => s,n,GotoIf($[${AVAILSTATUS} = 0|${AVAILSTATUS} = 1 ]?chanisavail)

the missing } was fixed several versions back

you should be running pbx manager 6.1.1.12

Submitted by chickenlip on Wed, 02/22/2012 Permalink

Hi Erik:

Thanks for the quick reply. I am indeed running 6.1.1.12. Not sure why this code wasn't updated. Would you recommend reinstalling the update package?

Regardless, I created a clone of tl-page and adjusted those two lines and it's now working correctly.

Thanks!

Submitted by michalsz2 on Wed, 11/14/2012 Permalink

Hi Erik,

I have same issue as chickenlip has.
Although I’ve checked and there two lines seem to be correct, but I still can’t page, and I’m getting same warning on debug.

-- Executing [s@macro-tl-page:7] NoOp("SIP/223-00000aa4", "TESTCHAN is "SIP/224" and and AVAILSTATUS is "1"") in new stack
[2012-11-14 15:20:55] WARNING[19755]: pbx.c:3880 pbx_substitute_variables_helper_full: Error in extension logic (missing '}')
[2012-11-14 15:20:55] WARNING[19755]: ast_expr2.fl:468 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected $end, expecting '-' or '!' or '(' or ''; Input:
1 = 0|

Here is current script on my TL:

| exten => s,1,Set(CHANS=${ARG1})
exten => s,n,Set(ORIGCHANS=${CHANS}) ; Keep a copy
exten => s,n(loopstart),While($[${LEN(${CHANS})} > 0])
exten => s,n,Set(TESTCHAN=${CUT(CHANS,&,1)})

; Reset CHANS to the substring of CHANS that removes the length of the TESTCHAN variable, plus 1 additional character (the '&')

exten => s,n,Set(CHANS=${CHANS:${MATH(${LEN(${TESTCHAN})}+1)}})
exten => s,n,ChanIsAvail(${TESTCHAN},s)
exten => s,n,NoOp(TESTCHAN is "${TESTCHAN}" and and AVAILSTATUS is "${AVAILSTATUS}")
exten => s,n,GotoIf($[${AVAILSTATUS} = 0|${AVAILSTATUS = 1 ]?chanisavail)
exten => s,n,Goto(loopstart) ; Loop back to top, don't add TESTCHAN to AVAILCHANS
exten => s,n(chanisavail),Set(AVAILCHANS=${AVAILCHANS}&${TESTCHAN})
exten => s,n,EndWhile
exten => s,n,Set(AVAILCHANS=${AVAILCHANS:1}) ; remove the leading '&'
exten => s,n,NoOp(Of original channels "${ORIGCHANS}", the available ones are "${AVAILCHANS}")
exten => s,n,SIPAddHeader(Alert-Info: )
exten => s,n,Set(_SIP_URI_OPTIONS=intercom=true)
exten => s,n,SIPAddHeader(Call-Info: <>\;answer-after=0)
exten => s,n,Page(${AVAILCHANS})

Argument description “phone to ring’
Argument type “phone/Lines”

Is there anything else that could be done,

Thank you

Regards

Mike