[Freeswitch-dev] Re-Routing to a new dialplan

Mathieu Rene mrene_lists at avgs.ca
Thu Jul 9 18:23:03 PDT 2009


If you are in an event you need to get a ptr to the session then use  
switch_ivr_session_transfer()

Like:
         switch_core_session_t *session;
	const char *destination = "dest";
         const char *dialplan = "XML";
         const char *context = "default";
	if ((session = switch_core_session_locate(uuid_here)) { /* The  
condition will catch race conditions where you get the event a couple  
milliseconds after the call has hung up */
		switch_ivr_session_transfer(session, destination, dialplan, context);
		switch_core_session_rwunlock(session);
	}


Definition: (in switch_ivr.h)
/*!
   \brief Transfer an existing session to another location
   \param session the session to transfer
   \param extension the new extension
   \param dialplan the new dialplan (OPTIONAL, may be NULL)
   \param context the new context (OPTIONAL, may be NULL)
*/
SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(_In_  
switch_core_session_t *session, const char *extension, const char  
*dialplan,
															const char *context);




Math

On 9-Jul-09, at 6:36 PM, Kevin Snow wrote:

>
> I’m working on a module in C and I’ve hit a little bit of a  
> stumbling block. I have a situation where I receive an event and in  
> response I want to send a known session to a new dialplan eventhough  
> it’s somewhere in the middle of another dialplan. I can’t find  
> examples of doing this in C.
>
> Are there examples of doing this or am I going about this the wrong  
> way.
>
> Thanks in advance!
>
> Kevin Snow
>
> _______________________________________________
> Freeswitch-dev mailing list
> Freeswitch-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20090709/b6502ce8/attachment-0001.html 


More information about the Freeswitch-dev mailing list