[asterisk-users] Macro inside macro
Attilla De Groot
mail at youmeandvoip.nl
Mon Aug 14 09:15:12 MST 2006
Well I solved the problem, by just making it one macro, not a macro
inside another one.
[macro-record]
exten => s,1,Setvar(CALLFILENAME=CALL-${ARG1}-${MACRO_EXTEN:4}-$
{TIMESTAMP})
exten => s,2,Monitor(wav,${CALLFILENAME},m})
exten => s,3,setcallerid(${ARG2})
exten => s,4,dial(${ARG3})
exten => h,1,System(/etc/asterisk/mail.sh mail at youmeandvoip.nl $
{CALLFILENAME} &)
Regards,
Attilla
On Aug 13, 2006, at 11:21 PM, Attilla De Groot wrote:
> On Aug 13, 2006, at 7:53 PM, Gonzalo Servat wrote:
>
>> I think what you probably want is:
>>
>> exten => _*22*X.,1,Macro(record,conference,${EXTEN:4})
>>
>> If you have _*23*., it means it will match *23**** as well as
>> *23*****************, but not *23*123456 which is probably what you
>> want. Try:
>>
>> exten => _*23*X.,1,Macro(record|dialout|31455200025|SIP/${EXTEN:4}
>> @voipbuster)
>
> I made both changes, but that wasn't a problem. If I understand it
> correctly, this only changes that the extension got more specific,
> right ?
>
>
>>
>> Also, from memory, the "h" extension gets executed from the main
>> context. After making the above changes, try adding this:
>>
>> exten => _*23*X.,h,System(/etc/asterisk/mail.sh mail at youmeandvoip.nl
>> ${CALLFILENAME} &)
>>
>> .. and remove the "h" extension from macro-record.
>>
>> Let me know if the above helps.
>
> I did make the changes, but it didn't solve the problem. It should
> be h,1,System by the way ;)
> I have some log here:
>
> -- Executing Macro("SIP/attilla-0dce", "record|dialout|31455200025|
> SIP/08001234 at sip1.voipbuster.com") in new stack
> -- Executing SetVar("SIP/attilla-0dce", "CALLFILENAME=CALL-
> dialout-08001234-20060813-231921") in new stack
> -- Executing Monitor("SIP/attilla-0dce", "wav|CALL-
> dialout-08001234-20060813-231921|m}") in new stack
> -- Executing GotoIf("SIP/attilla-0dce", "0?macro-record|s|
> 4:macro-record|s|5") in new stack
> -- Goto (macro-record,s,5)
> -- Executing Macro("SIP/attilla-0dce", "dialout|31455200025|SIP/
> 08001234 at sip1.voipbuster.com") in new stack
> -- Executing SetCallerID("SIP/attilla-0dce", "31455200025") in
> new stack
> -- Executing Dial("SIP/attilla-0dce", "SIP/
> 08001234 at sip1.voipbuster.com") in new stack
> -- Called 08001234 at sip1.voipbuster.com
> -- SIP/sip1.voipbuster.com-f715 is making progress passing it
> to SIP/attilla-0dce
> -- SIP/sip1.voipbuster.com-f715 answered SIP/attilla-0dce
> == Spawn extension (macro-dialout, s, 2) exited non-zero on 'SIP/
> attilla-0dce' in macro 'dialout'
> == Spawn extension (macro-dialout, s, 2) exited non-zero on 'SIP/
> attilla-0dce' in macro 'record'
> == Spawn extension (macro-dialout, s, 2) exited non-zero on 'SIP/
> attilla-0dce'
>
> As you can see it executes everything perfectly and I was expecting
> that after this the script would be executed.
>
>
> Regards,
> Attilla
>
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
More information about the asterisk-users
mailing list