<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Even in ESL, first I have to reject the call and start a new session.</div><div class="gmail_quote"><br></div><div class="gmail_quote">What is the command to reject a call in mod_python, I tried session.respond() that did not work.</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Python script :</div><div class="gmail_quote"><br></div><div class="gmail_quote">def handler(session, args):<br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">    namer = session.getVariable(&#39;caller_id_number&#39;)</div><div class="gmail_quote">    freeswitch.consoleLog(&#39;info&#39;,&#39;Called by &#39;+namer)</div><div class="gmail_quote">    session.respond()</div><div class="gmail_quote">    s = freeswitch.Session();</div><div class="gmail_quote">    s.originate(session,&quot; {sip_auth_username=1002,sip_auth_password=XXXXXXX}sofia/external/1002@XX.XX.XX.XX  9868789909&quot;)</div><div class="gmail_quote">   </div></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Sun, Jun 12, 2016 at 12:12 AM, Ken Rice <span dir="ltr">&lt;<a href="mailto:krice@freeswitch.org" target="_blank">krice@freeswitch.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>Look at your logs you&#39;ll notice that originate is not a dialplan command and after you hang up on the incoming call the channel is dead. The correct way to do this is with a script (probably ESl) that sees the incoming call hangs it up and triggers the originate command<br><br>Sent from my iPhone</div><div><div class="h5"><div><br>On Jun 11, 2016, at 1:26 PM, Deepika Yadav &lt;<a href="mailto:deepikay@iiitd.ac.in" target="_blank">deepikay@iiitd.ac.in</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">sorry for the incomplete message, please ignore the previous message.<div><br></div><div>I am creating the dialplan in this way:<div><br></div><div><div><div style="font-size:12.8px">&lt;include&gt;</div><div style="font-size:12.8px">  &lt;extension name=&quot;public_did&quot;&gt;</div><div style="font-size:12.8px">    &lt;condition field=&quot;destination_number&quot; expression=&quot;^(88888888)$&quot;&gt;  </div><div style="font-size:12.8px"><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;set&quot; data=&quot;callerID = $${caller_id_number}&quot;/&gt;<span style="white-space:pre-wrap">        </span></div><div style="font-size:12.8px"><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;log&quot; data=&quot;INFO src number is $${callerID}&quot;/&gt;</div><div style="font-size:12.8px">        &lt;action application=&quot;respond&quot; data=&quot;503&quot;/&gt;</div><div style="font-size:12.8px"><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;originate&quot; data=&quot;{sip_auth_username=1003,sip_auth_password=*******}sofia/external/<a href="mailto:1003@52.38.67.78" target="_blank">1003@</a>X.X.X.X $<span style="font-size:12.8px">callerID</span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">&quot;/&gt;</span></div><div style="font-size:12.8px"><span style="white-space:pre-wrap">        </span></div><div style="font-size:12.8px">    &lt;/condition&gt;</div><div style="font-size:12.8px">  &lt;/extension&gt;</div><div style="font-size:12.8px">&lt;/include&gt;</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div><div><span style="font-size:12.8px">&lt;extension name=&quot;show_prepare&quot;&gt;</span></div><div><span style="font-size:12.8px"><span style="white-space:pre-wrap">        </span>&lt;condition field=&quot;destination_number&quot; expression=&quot;^(?:\+91|0|)(\d{10})$&quot;&gt;</span></div><div><span style="font-size:12.8px">        </span></div><div><span style="font-size:12.8px"><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/MySIP/91$1&quot;/&gt;</span></div><div><span style="font-size:12.8px">      &lt;/condition&gt;</span></div><div><span style="font-size:12.8px">&lt;/extension&gt;  </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">After rejecting the call, new channel for outgoing call does not start , also variable &quot;</span><span style="font-size:12.8px">callerID&quot;</span><span style="font-size:12.8px"> is set to empty not capturing the source number</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Regards,</span></div><div><span style="font-size:12.8px">Deepika</span></div></div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 11, 2016 at 11:50 PM, Deepika Yadav <span dir="ltr">&lt;<a href="mailto:deepikay@iiitd.ac.in" target="_blank">deepikay@iiitd.ac.in</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I want to reject an incoming call from a mobile number in the public context and callback to it</div><div><br></div><div>how should the dialplan look like:</div><div><br></div><div><br></div><div><div>&lt;include&gt;</div><div>  &lt;extension name=&quot;public_did&quot;&gt;</div><div>    &lt;condition field=&quot;destination_number&quot; expression=&quot;^(88888888)$&quot;&gt;  </div><div><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;set&quot; data=&quot;domain_name=$${domain}&quot;/&gt;</div><div><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;log&quot; data=&quot;INFO domain is $${domain}&quot;/&gt;</div><div><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;set&quot; data=&quot;callerID = $${caller_id_number}&quot;/&gt;<span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;log&quot; data=&quot;INFO src number is $${callerID}&quot;/&gt;</div><div>&lt;action application=&quot;respond&quot; data=&quot;503&quot;/&gt;</div><div><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;bridge&quot; data=&quot;{sip_auth_username=1003,sip_auth_password=R@D~o$121$@IIITD}sofia/external/<a href="mailto:1003@52.38.67.78" target="_blank">1003@52.38.67.78</a> 9769658019&quot;/&gt;</div><div><span style="white-space:pre-wrap">        </span>&lt;!--&lt;action application=&quot;respond&quot; data=&quot;reponse_info&quot; data=&quot;407&quot;/&gt; --&gt;</div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>&lt;!--&lt;action application=&quot;transfer&quot; data=&quot;5000 XML default&quot;/&gt; --&gt;</div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>  </div><div>    &lt;/condition&gt;</div><div>  &lt;/extension&gt;</div><div>&lt;/include&gt;</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>Regards,</div><div>Deepika</div></div>
</blockquote></div><br></div>
</div></blockquote></div></div><blockquote type="cite"><div><span>_________________________________________________________________________</span><br><span>Professional FreeSWITCH Consulting Services: </span><br><span><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a></span><br><span><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a></span><br><span></span><br><span>Official FreeSWITCH Sites</span><br><span><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></span><br><span><a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a></span><br><span><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a></span><br><span></span><br><span>FreeSWITCH-users mailing list</span><br><span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a></span><br><span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></span><br><span>UNSUBSCRIBE:http://<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">lists.freeswitch.org/mailman/options/freeswitch-users</a></span><br><span><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></span></div></blockquote></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div></div>