[Asterisk-Users] Variable substitution - How can I do Dial(${DIALSTRING}) where ${DIALSTRING} is 'SIP/201, 15, tT'?

2004-11-29 Thread Nick Barnes

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.



___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Variable substitution - How can I do Dial(${DIALSTRING}) where ${DIALSTRING} is 'SIP/201, 15, tT'?

2004-11-29 Thread Christopher L. Wade
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 Administratordba Sparco.com
Email: [EMAIL PROTECTED] 7089 Ryburn Drive
Phone: (901) 872 2272 / (800) 840 8400Millington, TN 38053
Fax:   (901) 872 8482  USA
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Variable substitution - How can I doDial(${DIALSTRING}) where ${DIALSTRING} is 'SIP/201, 15, tT'?

2004-11-29 Thread Nick Barnes

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.



___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Variable substitution - How can I doDial(${DIALSTRING}) where ${DIALSTRING} is 'SIP/201, 15, tT'?

2004-11-29 Thread el Flynn
Nick Barnes wrote:
snip
[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
how about doing this:
[macro-dodial]
exten = s,1,SetCallerID(${ARG2})
exten = s,2,SetMusicOnHold(${ARG3})
exten = s,3,Dial(${ARG1},15,tT)
[some-context]
exten = s,1,Macro(dodial,SIP/201,123456,MOHClass)
this might work since the 15,tT bit might be generic enough for all 
the extens that are calling that macro.

flynn
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


[Asterisk-Users] Variable Substitution

2003-07-29 Thread Justin Eckhouse
Hi,

Can I do variable substitution in the [globals] section of extensions.conf?

For example something like this:

[globals]
EXT_BOB=4206  
PHONE_BOB=SIP/${EXT_BOB}

Thanks,
Justin

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Variable Substitution

2003-07-29 Thread Mark Spencer
No, not at this time.  If you think that's valuable, you could request it
as a feature in the bug tracker.

Mark

On Tue, 29 Jul 2003, Justin Eckhouse wrote:

 Hi,

 Can I do variable substitution in the [globals] section of extensions.conf?

 For example something like this:

 [globals]
 EXT_BOB=4206
 PHONE_BOB=SIP/${EXT_BOB}

 Thanks,
 Justin

 ___
 Asterisk-Users mailing list
 [EMAIL PROTECTED]
 http://lists.digium.com/mailman/listinfo/asterisk-users


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users