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">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 class="Apple-tab-span" style="white-space:pre">        </span>dst_num_context_str = string.split(dst_number,"-")</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>for dncs_index,dncs_str in pairs(dst_num_context_str) do</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>-- do some stuff</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>write_FS_LOG("DCNS Index", string.format("dcns_ind%s", dncs_index))</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>write_FS_LOG("DCNS VAR", string.format("%s", dncs_str))</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>session:setVariable("dcns_ind" .. dncs_index, dncs_str)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>orig_ucon = dncs_str</div><div><span class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </span>write_FS_ERRLOG("Missing data", "Missing user originating context")</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>write_FS_LOG("Script End Time", os.date("%Y-%m-%d %X"))</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>session:hangup()</div>
<div>else</div><div><span class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </span>write_FS_ERRLOG("Missing data", "session:getVariable(orig_transfer_digits)")</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>write_FS_LOG("Script End Time", os.date("%Y-%m-%d %X"))</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>session:hangup()</div><div>else</div><div><span class="Apple-tab-span" style="white-space:pre">        </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>