Nick Barnes
2004-Nov-29 12:38 UTC
[Asterisk-Users] Variable substitution - How can I do Dial(${DIALSTRING}) where ${DIALSTRING} is 'SIP/201, 15, tT'?
I've been banging my head against a brick wall for the last hour and I'm sure this is one of those easy to solve things - just that I can't see the wood for the trees. I'm trying to do: ----------- [some-context] Exten => s,1,Macro(dodial,'SIP/201,15,tT',123456,MOHClass) [macro-dodial] Exten => s,1,SetCallerID(${ARG2}) Exten => s,2,SetMusicOnHold(${ARG3}) Exten => s,3,Dial(${ARG1}) ----------- (there's a lot more to it than that, but the above should give you an idea of what I'm trying to achieve) A command starting at some-context,s,1 returns the following error: -- Executing Macro("SIP/200-b9d9", "dodial|SIP/201,15,tT|123456|MOHClass") in new stack -- Executing SetCallerID("SIP/200-b9d9", "123456") in new stack -- Executing SetMusicOnHold("SIP/200-b9d9", "MOHClass") in new stack Nov 29 19:43:09 WARNING[802835]: pbx.c:1280 pbx_extension_helper: No application 'Dial{${ARG1})' for extension (macro-dodial, s, 5) == Spawn extension (macro-dodial, s, 5) exited non-zero on 'SIP/200-b9d9' in macro 'dodial' == Spawn extension (from-sip, 201, 2) exited non-zero on 'SIP/200-b9d9' Is there any way I can achieve this without having to pass each of the dial parameters to the macro individually? Cheers, Nick.
Christopher L. Wade
2004-Nov-29 12:57 UTC
[Asterisk-Users] Variable substitution - How can I do Dial(${DIALSTRING}) where ${DIALSTRING} is 'SIP/201, 15, tT'?
Nick Barnes wrote: <snip>> Exten => s,3,Dial(${ARG1}) ><snip>> ----------- > Nov 29 19:43:09 WARNING[802835]: pbx.c:1280 pbx_extension_helper: No > application 'Dial{${ARG1})' for extension (macro-dodial, s, 5)<snip> Look very close at this output. Unless you did a copy-and-paste of your extensions.conf segment, I would say that you typed, in your actual extensions.conf, 'Dial{${ARG1})' instead of 'Dial(${ARG1})'. Notice the '{' vs '(' ? That, or did you type out that entire CLI output? Anyway, my $0.00. (feeling stingy today :) Chris -- Christopher L. Wade Unistar-Sparco Computers, Inc. Senior Systems Administrator dba Sparco.com Email: clwade@sparco.com 7089 Ryburn Drive Phone: (901) 872 2272 / (800) 840 8400 Millington, TN 38053 Fax: (901) 872 8482 USA
Nick Barnes
2004-Nov-29 14:13 UTC
[Asterisk-Users] Variable substitution - How can I doDial(${DIALSTRING}) where ${DIALSTRING} is 'SIP/201, 15, tT'?
OK, sorry for the mistakes....> in new stack Nov 29 19:43:09 WARNING[802835]: pbx.c:1280 > pbx_extension_helper: No application 'Dial{${ARG1})' for > extension (macro-dodial, s, 5)Should have read: -- Executing Dial("SIP/201-aca6", "SIP/201,15,tT") in new stack Nov 29 21:14:05 WARNING[868371]: chan_sip.c:1386 create_addr: No such host: 201,15,tT Nov 29 21:14:05 NOTICE[868371]: app_dial.c:756 dial_exec: Unable to create channel of type 'SIP' And, if I change the contents of the ${ARG1} to 'SIP/201|15|tT' then things get very weird. So: [some-context] Exten => s,1,Macro(dodial,'SIP/201,15,tT',123456,MOHClass) [macro-dodial] Exten => s,1,SetCallerID(${ARG2}) Exten => s,2,SetMusicOnHold(${ARG3}) Exten => s,3,Dial(${ARG1}) Gives: -- Executing Macro("SIP/200-aca6", "dodial|SIP/201,15,tT|123456|MOHClass") in new stack -- Executing SetCallerID("SIP/201-aca6", "123456") in new stack -- Executing SetMusicOnHold("SIP/200-aca6", "FRED") in new stack -- Executing Dial("SIP/200-aca6", "SIP/201,15,tT") in new stack Nov 29 21:14:05 WARNING[868371]: chan_sip.c:1386 create_addr: No such host: 201,15,tT Nov 29 21:14:05 NOTICE[868371]: app_dial.c:756 dial_exec: Unable to create channel of type 'SIP' == Everyone is busy/congested at this time And: [some-context] Exten => s,1,Macro(dodial,'SIP/201|15|tT',123456,MOHClass) [macro-dodial] Exten => s,1,SetCallerID(${ARG2}) Exten => s,2,SetMusicOnHold(${ARG3}) Exten => s,3,Dial(${ARG1}) Gives: -- Executing Macro("SIP/200-c515", "dodial|SIP/201|15|tT|123456|MOHClass") in new stack -- Executing SetCallerID("SIP/200-c515", "15") in new stack -- Executing SetMusicOnHold("SIP/200-c515", "tT") in new stack -- Executing Dial("SIP/200-c515", "SIP/201") in new stack Nov 29 21:18:29 NOTICE[884755]: channel.c:284 ast_alloc_uniqueid: uid asterisk-158-1101763109.38 -- Called 201 Which I can't quite get my head round. Any ideas? Nick.
Seemingly Similar Threads
- Setting Music on Hold with the Manager Interface
- Aastra ignore call button hangs up call instead of going to voicemail
- gtalk dialstring?
- SIP dialing with authentication with dialstring and wothout sip; conf
- Asterisk 13.4.0 - mixmonitor only records one side's perspective