<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">If you are in an event you need to get a ptr to the session then use switch_ivr_session_transfer()<div><br></div><div>Like:</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;switch_core_session_t *session;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>const&nbsp;char&nbsp;*destination&nbsp;=&nbsp;"dest";</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;const char *dialplan = "XML";</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;const char *context = "default";</div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>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 */</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>switch_ivr_session_transfer(session, destination, dialplan, context);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>switch_core_session_rwunlock(session);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br></div><div><br></div><div>Definition: (in switch_ivr.h)</div><div><div>/*!</div><div>&nbsp;&nbsp;\brief Transfer an existing session to another location</div><div>&nbsp;&nbsp;\param session the session to transfer</div><div>&nbsp;&nbsp;\param extension the new extension</div><div>&nbsp;&nbsp;\param dialplan the new dialplan (OPTIONAL, may be NULL)</div><div>&nbsp;&nbsp;\param context the new context (OPTIONAL, may be NULL)</div><div>*/</div><div>SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(_In_ switch_core_session_t *session, const char *extension, const char *dialplan,</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                                                                        </span>const char *context);</div><div><br></div><div><br></div></div><div><br></div><div><br></div><div>Math</div></div><div><br><div><div>On 9-Jul-09, at 6:36 PM, Kevin Snow wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div> <font face="Verdana, Helvetica, Arial"><span style="font-size:12.0px"><br> 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.<br> <br> Are there examples of doing this or am I going about this the wrong way.<br> <br> Thanks in advance!<br> <br> Kevin Snow<br> <br> </span></font> </div>  _______________________________________________<br>Freeswitch-dev mailing list<br><a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev<br>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev<br>http://www.freeswitch.org<br></blockquote></div><br></div></body></html>