<html><body bgcolor="#FFFFFF"><div>And Sherwood beats me to the punch again :).&nbsp;<br><br>Thanks,<div>--Warren Selby, dCAP</div></div><div><br>On May 5, 2011, at 1:15 PM, Sherwood McGowan &lt;<a href="mailto:sherwood.mcgowan@gmail.com">sherwood.mcgowan@gmail.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div>No, the variables are channel specific except for when they're inherited, which doesn't affect you here<br><br><div class="gmail_quote">On Thu, May 5, 2011 at 1:02 PM, satish patel <span dir="ltr">&lt;<a href="mailto:satish_lx@hotmail.com"><a href="mailto:satish_lx@hotmail.com">satish_lx@hotmail.com</a></a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">



<div>
After google i found something and i tried following. I set variable before Dial and its give me proper value in "h" extension but now question is if multiple user dial multiple extension then will it&nbsp; overwrite current variable value ? <br>
<br>exten =&gt; s,1,Set(_CALLED_EXT=${ARG2})<br>exten =&gt; s,n,Dial(${ARG2}&amp;iax2/${ARG1},20,t)&nbsp;&nbsp; <br><div class="im"><br><hr>From: <a href="mailto:satish_lx@hotmail.com" target="_blank"><a href="mailto:satish_lx@hotmail.com">satish_lx@hotmail.com</a></a><br>To: <a href="mailto:asterisk-users@lists.digium.com" target="_blank"><a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a></a><br>
</div>Date: Thu, 5 May 2011 17:52:54 +0000<div><div></div><div class="h5"><br>Subject: Re: [asterisk-users] missed call notification<br><br>






Could you please tell me how ( Syntax ) and where in macro ?<br><br>I am not expert in dialplan variables. I appreciate your help&nbsp; <br><br><hr>Date: Thu, 5 May 2011 12:44:19 -0500<br>From: <a href="mailto:sherwood.mcgowan@gmail.com" target="_blank"><a href="mailto:sherwood.mcgowan@gmail.com">sherwood.mcgowan@gmail.com</a></a><br>
To: <a href="mailto:asterisk-users@lists.digium.com" target="_blank"><a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a></a><br>Subject: Re: [asterisk-users] missed call notification<a title="Send (Ctrl+Enter)"><span></span></a><br><br>if you saved ${_CALLED_EXT} to the value of ${EXTEN} from within the macro, you'd get 's'....do it while you still have the called number as the EXTEN<br>
<br><div>On Thu, May 5, 2011 at 12:42 PM, satish patel <span dir="ltr">&lt;<a href="mailto:satish_lx@hotmail.com" target="_blank"><a href="mailto:satish_lx@hotmail.com">satish_lx@hotmail.com</a></a>&gt;</span> wrote:<br>
<blockquote style="padding-left:1ex">



<div>
<br><pre>Also check for CANCEL, since this should be the status if the caller<br>hangs up before the call is picked up.<br><br>But CANCEL is return nothing <div><br><br>[macro-stdexten]<br>exten =&gt; s,1,Dial(${ARG2}&amp;iax2/${ARG1},20,t)             ; Ring the interface, 20 seconds maximum, call screening option (or use P for databased call screening)<br>

exten =&gt; s,n,Goto(s-${DIALSTATUS},1)                     ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)<br>;exten =&gt; s,n,Hangup()<br><br></div>exten =&gt; s-CANCEL,1,Verbose(Hangup call)<br><br>

<br><br>CLI<br> == Spawn extension (macro-stdexten, s, 1) exited non-zero on 'SIP/7527-00000023' in macro 'stdexten'<br>  == Spawn extension (from-sip, 7516, 1) exited non-zero on 'SIP/7527-00000023'<br>

<br><br>Look like its going back to original extension :( I hate macro <br></pre><br><br><hr>From: <a href="mailto:satish_lx@hotmail.com" target="_blank"><a href="mailto:satish_lx@hotmail.com">satish_lx@hotmail.com</a></a><div><br>To: <a href="mailto:asterisk-users@lists.digium.com" target="_blank"><a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a></a><br>

</div>Date: Thu, 5 May 2011 17:15:53 +0000<div><div></div><div><br>Subject: Re: [asterisk-users] missed call notification<br><br>






You want me to do this in macro-stdexten ? I have following dialplan.&nbsp; I have used "h" extension in original context because you can't you "h" inside macro right ? <br><br>[macro-stdexten]<br>exten =&gt; s,1,Dial(${ARG2}&amp;iax2/${ARG1},20,t)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Ring the interface, 20 seconds maximum, call screening option (or use P for databased call screening)<br>

exten =&gt; s,n,Goto(s-${DIALSTATUS},1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)<br>exten =&gt; s,n,Hangup()<br>exten =&gt; s-NOANSWER,1,Voicemail(${ARG1},u)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; If unavailable, send to voicemail w/ unavail announce<br>

exten =&gt; s-NOANSWER,n,Hangup()<br>exten =&gt; s-BUSY,1,Voicemail(${ARG1},b)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; If busy, send to voicemail w/ busy announce<br>exten =&gt; s-BUSY,n,Hangup()<br>exten =&gt; s-CONGESTION,1,Voicemail(${ARG1},u)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Like above, write a macro for this case<br>

exten =&gt; s-CONGESTION,n,Hangup()<br>exten =&gt; _s-.,1,Goto(s-NOANSWER,1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Treat anything else as no answer<br>exten =&gt; a,1,VoicemailMain(${ARG1})&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; If they press *, send the user into VoicemailMain<br>

<br><br>[from-sip]<br>...blah...blah..<br><br>exten =&gt; h,1,System(/var/lib/asterisk/agi-bin/processcallemail.sh "" 
"${CALLERID(num)}" "${CALLERID(name)}" "${DIALSTATUS}" "${VMSTATUS}")<br><br><br><br><br><br>&gt; From: <a href="mailto:wcselby@selbytech.com" target="_blank"><a href="mailto:wcselby@selbytech.com">wcselby@selbytech.com</a></a><br>

&gt; Date: Thu, 5 May 2011 12:10:09 -0500<br>&gt; To: <a href="mailto:asterisk-users@lists.digium.com" target="_blank"><a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a></a><br>&gt; Subject: Re: [asterisk-users] missed call notification<br>

&gt; <br>&gt; Set a variable ${_CALLED_EXT} to ${EXTEN} before you hang up the call, then reference that variable in your h exten. <br>&gt; <br>&gt; Thanks,<br>&gt; --Warren Selby, dCAP<br>&gt; <br>&gt; On May 5, 2011, at 11:59 AM, satish patel &lt;<a href="mailto:satish_lx@hotmail.com" target="_blank"><a href="mailto:satish_lx@hotmail.com">satish_lx@hotmail.com</a></a>&gt; wrote:<br>

&gt; <br>&gt; &gt; Hi All,<br>&gt; &gt; <br>&gt; &gt; I am using <a href="http://www.theschmandts.org/blog/2007/05/05/email-notifications-for-missed-calls-in-asterisk/" target="_blank"><a href="http://www.theschmandts.org/blog/2007/05/05/email-notifications-for-missed-calls-in-asterisk/">http://www.theschmandts.org/blog/2007/05/05/email-notifications-for-missed-calls-in-asterisk/</a></a>   to implement missed call feature. and i modify script to grab email address from voicemail.conf <br>

&gt; &gt; <br>&gt; &gt; But i am not able to see DEST extension in this script ?  what would be the variable to get destination extension so base on that i can grab email address of user from voicemail.conf <br>&gt; &gt; <br>

&gt; &gt; exten =&gt; h,1,System(/var/lib/asterisk/agi-bin/processcallemail.sh "" "${CALLERID(num)}" "${CALLERID(name)}" "${DIALSTATUS}" "${VMSTATUS}")<br>&gt; &gt; <br>&gt; &gt; Calling from 7527&lt;--to---&gt;7101  but i can see only 7527 not dest 7101<br>

&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; CLI outout<br>&gt; &gt;     -- Executing [h@from-sip:1] System("SIP/7527-0000000d", "/var/lib/asterisk/agi-bin/processcallemail.sh "" "7527" "Guest" "CANCEL" """) in new stack<br>

&gt; &gt; shirley*CLI&gt; exit<br>&gt; &gt; <br>&gt; &gt; --<br>&gt; &gt; _____________________________________________________________________<br>&gt; &gt; -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank"><a href="http://www.api-digital.com">http://www.api-digital.com</a></a> --<br>

&gt; &gt; New to Asterisk? Join us for a live introductory webinar every Thurs:<br>&gt; &gt;               <a href="http://www.asterisk.org/hello" target="_blank"><a href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a></a><br>&gt; &gt; <br>&gt; &gt; asterisk-users mailing list<br>

&gt; &gt; To UNSUBSCRIBE or update options visit:<br>&gt; &gt;   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank"><a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></a><br>&gt; <br>&gt; --<br>

&gt; _____________________________________________________________________<br>&gt; -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank"><a href="http://www.api-digital.com">http://www.api-digital.com</a></a> --<br>&gt; New to Asterisk? Join us for a live introductory webinar every Thurs:<br>

&gt;                <a href="http://www.asterisk.org/hello" target="_blank"><a href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a></a><br>&gt; <br>&gt; asterisk-users mailing list<br>&gt; To UNSUBSCRIBE or update options visit:<br>&gt;    <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank"><a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></a><br>

                                               
<br></div></div>--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank"><a href="http://www.api-digital.com">http://www.api-digital.com</a></a> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <a href="http://www.asterisk.org/hello" target="_blank"><a href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a></a>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank"><a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></a>                                               </div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank"><a href="http://www.api-digital.com">http://www.api-digital.com</a></a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.asterisk.org/hello" target="_blank"><a href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a></a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
 &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank"><a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></a><br></blockquote></div><br><br clear="all"><br>-- <br>Sherwood McGowan<br>Telecommunications and VOIP Consultant<br>

<br>
<br>--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank"><a href="http://www.api-digital.com">http://www.api-digital.com</a></a> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <a href="http://www.asterisk.org/hello" target="_blank"><a href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a></a>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank"><a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></a>                                               
<br></div></div>--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank"><a href="http://www.api-digital.com">http://www.api-digital.com</a></a> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <a href="http://www.asterisk.org/hello" target="_blank"><a href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a></a>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank"><a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></a>                                               </div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank"><a href="http://www.api-digital.com">http://www.api-digital.com</a></a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.asterisk.org/hello" target="_blank"><a href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a></a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
 &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank"><a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></a><br></blockquote></div><br><br clear="all"><br>-- <br>Sherwood McGowan<br>Telecommunications and VOIP Consultant<br>
<br>
</div></blockquote><blockquote type="cite"><div><span>--</span><br><span>_____________________________________________________________________</span><br><span>-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com">http://www.api-digital.com</a> --</span><br><span>New to Asterisk? Join us for a live introductory webinar every Thurs:</span><br><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.asterisk.org/hello"><a href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a></a></span><br><span></span><br><span>asterisk-users mailing list</span><br><span>To UNSUBSCRIBE or update options visit:</span><br><span> &nbsp;&nbsp;<a href="http://lists.digium.com/mailman/listinfo/asterisk-users"><a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></a></span></div></blockquote></body></html>