if you saved ${_CALLED_EXT} to the value of ${EXTEN} from within the macro, you&#39;d get &#39;s&#39;....do it while you still have the called number as the EXTEN<br><br><div class="gmail_quote">On Thu, May 5, 2011 at 12:42 PM, satish patel <span dir="ltr">&lt;<a href="mailto:satish_lx@hotmail.com">satish_lx@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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 class="im"><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 &#39;SIP/7527-00000023&#39; in macro &#39;stdexten&#39;<br>  == Spawn extension (from-sip, 7516, 1) exited non-zero on &#39;SIP/7527-00000023&#39;<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">satish_lx@hotmail.com</a><div class="im"><br>To: <a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a><br>
</div>Date: Thu, 5 May 2011 17:15:53 +0000<div><div></div><div class="h5"><br>Subject: Re: [asterisk-users] missed call notification<br><br>






You want me to do this in macro-stdexten ? I have following dialplan.  I have used &quot;h&quot; extension in original context because you can&#39;t you &quot;h&quot; inside macro right ? <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>exten =&gt; s-NOANSWER,1,Voicemail(${ARG1},u)               ; If unavailable, send to voicemail w/ unavail announce<br>
exten =&gt; s-NOANSWER,n,Hangup()<br>exten =&gt; s-BUSY,1,Voicemail(${ARG1},b)                   ; If busy, send to voicemail w/ busy announce<br>exten =&gt; s-BUSY,n,Hangup()<br>exten =&gt; s-CONGESTION,1,Voicemail(${ARG1},u)             ; Like above, write a macro for this case<br>
exten =&gt; s-CONGESTION,n,Hangup()<br>exten =&gt; _s-.,1,Goto(s-NOANSWER,1)                       ; Treat anything else as no answer<br>exten =&gt; a,1,VoicemailMain(${ARG1})                      ; 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 &quot;&quot; 
&quot;${CALLERID(num)}&quot; &quot;${CALLERID(name)}&quot; &quot;${DIALSTATUS}&quot; &quot;${VMSTATUS}&quot;)<br><br><br><br><br><br>&gt; From: <a href="mailto:wcselby@selbytech.com" target="_blank">wcselby@selbytech.com</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">asterisk-users@lists.digium.com</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">satish_lx@hotmail.com</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">http://www.theschmandts.org/blog/2007/05/05/email-notifications-for-missed-calls-in-asterisk/</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 &quot;&quot; &quot;${CALLERID(num)}&quot; &quot;${CALLERID(name)}&quot; &quot;${DIALSTATUS}&quot; &quot;${VMSTATUS}&quot;)<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(&quot;SIP/7527-0000000d&quot;, &quot;/var/lib/asterisk/agi-bin/processcallemail.sh &quot;&quot; &quot;7527&quot; &quot;Guest&quot; &quot;CANCEL&quot; &quot;&quot;&quot;) 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">http://www.api-digital.com</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">http://www.asterisk.org/hello</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">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>&gt; <br>&gt; --<br>
&gt; _____________________________________________________________________<br>&gt; -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</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">http://www.asterisk.org/hello</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">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
                                               
<br></div></div>--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a>

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