I honestly don't mean to be a smart alleck, but the warning "No B-leg present" is exactly what is wrong. This is a one-legged call into a Lua script, therefore there is only the A-leg. That means this line is incorrect:<br>
<br>session:execute("transfer", "-bleg " .. orig_transfer_digits .. " XML " .. orig_ucon)<br><br>The session that the Lua script is controlling is not bridged to another leg (which would be the B-leg) and so there is no reason to try and transfer the B-leg. Perhaps you could just do a simple transfer?<br>
<br>-MC<br><br><div class="gmail_quote">On Thu, Jul 5, 2012 at 7:07 PM, KPS Maillinglist <span dir="ltr"><<a href="mailto:ksims.ml@gmail.com" target="_blank">ksims.ml@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi All,<div>I have a issue where when i transfer a call using lua. It tells me that "[WARNING] mod_dptools.c:976 No B-leg present."</div><div><br></div><div>Below you will find some background info:</div><div><br>
</div><div>@@@@@@@@@@ Log:</div><div><a href="http://pastebin.freeswitch.org/19458" target="_blank">http://pastebin.freeswitch.org/19458</a></div><div><br></div><div>@@@@@@@@@@ lua file relevant potions</div><div><div>########## dx_script.lua ######################<table>
</table></div><div>session:setAutoHangup(false)</div><div><br></div><div>session:answer();</div><div>session:set_tts_parms("cepstral", "amy");</div><div><br></div><div>-- session:execute("", "")</div>
<div><br></div><div>digits = session:read(4, 11, "tone_stream://%(10000,0,350,440)", 5000, "#")</div><div>write_FS_LOG("Got dtmf: ", digits) </div>
<div>--freeswitch.consoleLog("info", "Got dtmf: ".. digits .."\n");</div><div>--session:execute("read", "11 11 'tone_stream://%(10000,0,350,440)' digits 5000 #")</div>
<div>session:execute("export","orig_transfer_digits=" .. digits)</div><div>session:setVariable("orig_transfer_digits", digits)</div><div>session:setVariable("orig_user_context",usr_context)</div>
<div>session:execute("export","orig_user_context=" .. usr_context)</div><div>atoit = string.sub(dst_number, 4)</div><div>session:execute("transfer", "is_transfer-" .. atoit .. " XML FEATURES")</div>
<div><br></div><div><br></div><div>write_FS_LOG("Script End Time: ", os.date("%Y-%m-%d %X"))</div></div><div><br></div><div>############### is_transfer_script.lua ######################</div><div><div>
<br></div><div>if string.find(dst_number, "-") ~= nil then</div><div><span style="white-space:pre-wrap">        </span>dst_num_context_str = string.split(dst_number,"-")</div><div><span style="white-space:pre-wrap">        </span>for dncs_index,dncs_str in pairs(dst_num_context_str) do</div>
<div><span style="white-space:pre-wrap">                </span>-- do some stuff</div><div><span style="white-space:pre-wrap">                </span>write_FS_LOG("DCNS Index", string.format("dcns_ind%s", dncs_index))</div>
<div><span style="white-space:pre-wrap">                </span>write_FS_LOG("DCNS VAR", string.format("%s", dncs_str))</div><div><span style="white-space:pre-wrap">                </span>session:setVariable("dcns_ind" .. dncs_index, dncs_str)</div>
<div><span style="white-space:pre-wrap">                </span>orig_ucon = dncs_str</div><div><span style="white-space:pre-wrap">        </span>end</div><div>end</div><div>-- orig_ucon = session:getVariable("dcns_ind2")</div>
<div>-- orig_ucon = dcns_ind2</div><div>write_FS_LOG("orig_ucon", orig_ucon)</div><div><br></div><div>if orig_ucon == nil then</div><div><span style="white-space:pre-wrap">        </span>write_FS_ERRLOG("Missing data", "Missing user originating context")</div>
<div><span style="white-space:pre-wrap">        </span>write_FS_LOG("Script End Time", os.date("%Y-%m-%d %X"))</div><div><span style="white-space:pre-wrap">        </span>session:hangup()</div>
<div>else</div><div><span style="white-space:pre-wrap">        </span>write_FS_LOG("Recieved Context - Continuing...", orig_ucon)</div><div>end</div><div><br></div><div>if session:getVariable("orig_transfer_digits") == nil then</div>
<div><span style="white-space:pre-wrap">        </span>write_FS_ERRLOG("Missing data", "session:getVariable(orig_transfer_digits)")</div><div><span style="white-space:pre-wrap">        </span>write_FS_LOG("Script End Time", os.date("%Y-%m-%d %X"))</div>
<div><span style="white-space:pre-wrap">        </span>session:hangup()</div><div>else</div><div><span style="white-space:pre-wrap">        </span>write_FS_LOG("Recieved digits - Continuing...", session:getVariable("orig_transfer_digits"))</div>
<div>end</div><div><br></div><div>-- session:execute("info","")</div><div>-- session:execute("info","")</div><div><br></div><div>-- orig_user_context = session:getVariable("orig_user_context")</div>
<div>orig_transfer_digits = session:getVariable("orig_transfer_digits")</div><div><br></div><div>write_FS_LOG("Script: ", "regsrv is_transfer_script.lua")</div><div>write_FS_LOG("Script Start Time: ", os.date("%Y-%m-%d %X"))</div>
<div>session:setAutoHangup(false)</div><div><br></div><div>session:answer();</div><div>session:set_tts_parms("cepstral", "amy");</div><div><br></div><div>-- session:execute("", "")</div>
<div><br></div><div>session:execute("transfer", "-bleg " .. orig_transfer_digits .. " XML " .. orig_ucon)</div><div><br></div><div><br></div><div>write_FS_LOG("Script End Time: ", os.date("%Y-%m-%d %X"))</div>
</div><div><br></div><div><br></div><div>@@@@@@@@@@ dialplan<document type="freeswitch/xml"><table></table> <section name="dialplan" description="FreeSWITCH Dialplan"><table></table>
<context name="FEATURES"><table></table> <extension name="DX"><table></table> <condition field="destination_number" expression="^DX-.*"><table></table>
<action application="lua" data="/fs/scripts/users/dx_script.lua"/><table></table> </condition><table></table> </extension><table></table> <extension name="is_transfer"><table>
</table> <condition field="destination_number" expression="^is_transfer-.*"><table></table> <action application="lua" data="/fs/scripts/users/is_transfer_script.lua"/><table>
</table> <anti-action application="eval" data="cancel transfer"/><table></table> </condition><table></table> </extension><table></table> </context><table>
</table> </section><table></table><table></table><br></document><table></table></div><div></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" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<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>