<div dir="ltr"><font color="#333333"><font face="verdana,sans-serif">Do you mean that you want that when the IVR is done without a hangup command it should continue down the xml file?</font></font><div><font color="#333333"><font face="verdana,sans-serif"><br>
</font></font></div><div><font color="#333333"><font face="verdana,sans-serif"><br clear="all"></font></font>Yitzchok<br>
<br><br><div class="gmail_quote">On Mon, Jan 10, 2011 at 5:03 PM, Zac Wolfe <span dir="ltr"><<a href="mailto:zacw@safisystems.com">zacw@safisystems.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi guys,<br><br>First some good news: we're finally close to releasing our free IVR Development platform SafiServer/SafiWorkshop (<a href="http://www.safisystems.com" target="_blank">www.safisystems.com</a>) with FreeSWITCH support! It's happening much later than we originally anticipated as we've been unexpectedly busy with contracting opportunities but I think it will be worth the wait. Currently everything is working fine with one minor exception: if the user-created script (we call them Saflets) doesn't explicitly hang up the call, the call will remain parked until the caller hangs up. Some details:<br clear="all">
<br>In Asterisk we invoke our server-side scripting applications via the extensions.conf using the following syntax:<br><br>exten = 1111,1,Agi(agi://<a href="http://192.168.0.10:3573/safletEngine.agi?saflet=project1/callflow1" target="_blank">192.168.0.10:3573/safletEngine.agi?saflet=project1/callflow1</a>)<br>
<br>Here '192.168.0.10' is the IP address of the SafiServer and project1/callflow1 identifies the Saflet to be executed. Asterisk creates a socket connection to the SafiServer and, once the socket is disconnected, the call proceeds to the next entry in the dialplan (typically 'hangup').<br>
<br>For FreeSWITCH, the process is slightly different. Currently, rather than create a separate socket connection for each incoming call, we're invoking an event that informs the SafiServer that there is a new incoming call. The event contains the contextual information including the Saflet name. For example:<br>
<br><extension name="9194"><br> <condition field="destination_number" expression="9194$"><br> <action inline="true" application="set" data="saficall=true"/><br>
<action application="event" data="Event-Subclass=saficall::incoming,Event-Name=CUSTOM,saflet_project=test,saflet=flow1,new_saficall=true"/><br> <br> <!-- <action application="set" data="park_timeout=10"/> --><br>
<action application="park" /><br> </condition><br> </extension><br><br>So once the event is fired, the call is parked to prevent further execution within the dialplan. From there on, SafiServer is controlling the call via Inbound Mod event socket. <br>
<br>So this works perfectly, except that if the invoked Saflet doesn't explicitly hang-up the call it will remain parked until the caller hangs up. My question is, is there a better way to do this? Is there some better alternative to park in this case? Ideally I'd like to initiate a 'session' of some kind when the SafiServer is "controlling" the call and then exit that session as soon as the Saflet is complete, at which point the call would continue on to the next entry in the dialplan. I understand I could use Outbound sockets to achieve this but, as I mentioned, I'd like to avoid the overhead of a separate socket connection for each incoming call. <br>
<br>I actually have a mod_saficall.c app that does basically the the same thing as I described in the dialplan entry. Perhaps there's something more I could do in code that would allow me to be notified when the session is complete. Here's the relevant code I have so far:<br>
<br> switch_channel_t *channel = NULL;<br> switch_event_t *event;<br> const char *safiCallFlag = NULL;<br> channel = switch_core_session_get_channel(session);<br><br> safiCallFlag = switch_channel_get_variable(channel, "saficall");<br>
<br> if (!safiCallFlag)<br> switch_channel_set_variable(channel, "saficall", "true");<br> <br> <br> if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, "saficall::incoming") == SWITCH_STATUS_SUCCESS) {<br>
<br> switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "new_saficall", safiCallFlag ? "false" : "true");<br><br> switch_channel_event_set_data(channel, event);<br>
switch_event_fire(&event);<br> switch_ivr_park(session, NULL);<br> }<br> <br>Any ideas you might have on this are welcome.<br><br>Thanks,<br><font color="#888888">Zac Wolfe<br>Safi Systems LLC<br>
<a href="http://www.safisystems.com" target="_blank">www.safisystems.com</a><br>
</font><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" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div>