Okay, turn off the sip trace and turn on debug level logging:<div><br></div><div>sofia global siptrace off</div><div>console loglevel 7</div><div><br></div><div>Test call again, pastebin log please.</div><div>-MC<br><br><div class="gmail_quote">
On Fri, Jul 15, 2011 at 10:05 AM, Boris Kovalenko <span dir="ltr"><<a href="mailto:boris@tagnet.ru">boris@tagnet.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#FFFFFF" text="#000000">
:) Nice joke<br>
<br>
<br>
Ok. Pastebin: <a href="http://pastebin.freeswitch.org/16818" target="_blank">http://pastebin.freeswitch.org/16818</a><br>
<br>
The extension is:<br>
<extension name="ext_office_disa2"><br>
<condition field="destination_number"
expression="^(73435230022)$"><br>
<action application="set"
data="disa_msg_enterpin=$${base_dir}/sound<br>
s/ru/RU/elena/ivr/8000/ivr-please_enter_pin_followed_by_pound.wav"/><br>
<action application="set"
data="disa_msg_wrongpin=$${base_dir}/sound<br>
s/ru/RU/elena/ivr/8000/ivr-pin_or_extension_is-invalid.wav"/><br>
<action application="set"
data="disa_msg_enterext=$${base_dir}/sound<br>
s/ru/RU/elena/ivr/8000/ivr-enter_ext.wav"/><br>
<action application="lua" data="common/disa.lua"/><br>
<!-- <action application="javascript"
data="common/disa2.js"/> --><br>
</condition><br>
</extension><br>
<br>
<br>
LUA script:<br>
--[[<br>
]]<br>
<br>
-- if you choose not to require a pin then then you may want to add
a dialplan c<br>
ondition for a specific caller id<br>
local pin = "111111"; -- make sure to change the PIN number.<br>
<br>
local digitmaxlength = 0;<br>
local initialTimeout = 7500;<br>
local interdigitTimeout = 5000;<br>
local absoluteTimeout = 30000;<br>
<br>
local msg_enterpin;<br>
local msg_wrongPin;<br>
local msg_enterext;<br>
<br>
function disa()<br>
if( not session:ready() ) then<br>
return<br>
end<br>
<br>
<br>
msg_enterpin = session:getVariable("disa_msg_enterpin");<br>
msg_wrongpin = session:getVariable("disa_msg_wrongpin");<br>
msg_enterext = session:getVariable("disa_msg_enterext");<br>
<br>
if( msg_enterpin == nil or msg_wrongpin == nil or msg_enterext
== nil ) then<br>
freeswitch.consoleLog("ALERT", "DISA: Please set necessary
variables");<br>
return false;<br>
end<br>
<br>
session:answer();<br>
session:sleep( 500 );<br>
<br>
-- session:execute("start_dtmf", "");<br>
<br>
if( string.len( pin ) > 0 ) then<br>
digitmaxlength = 6;<br>
<br>
session:flushDigits();<br>
digits = session:playAndGetDigits(digitmaxlength,
digitmaxlength, 1, int<br>
erdigitTimeout, "#", msg_enterpin, msg_wrongpin, "\\d+",
absoluteTimeout);<br>
freeswitch.consoleLog( "info", "DISA.lua pin: " .. digits ..
"\n" );<br>
end<br>
<br>
if( digits == pin or string.len( pin ) == 0 ) then<br>
local ru_ring = session:getVariable("ru-ring");<br>
local originate_string;<br>
<br>
originate_session = nil;<br>
<br>
session:setVariable("ringback", ru_ring); --
set to ringto<br>
ne<br>
session:setVariable("transfer_ringback", ru_ring); --
set to ringto<br>
ne<br>
session:setVariable("hangup_after_bridge", "true");<br>
session:setVariable("v_numbering_plan", "RU");<br>
<br>
digits = ""; -- clear dtmf digits to prepare for next
dtmf request<br>
digitmaxlength = 20;<br>
session:flushDigits();<br>
digits = session:playAndGetDigits(6, digitmaxlength, 1,
interdigitTimeou<br>
t, "#", msg_enterext, "", "\\d+", absoluteTimeout);<br>
if( string.len( digits ) == 0 ) then<br>
return false;<br>
end<br>
freeswitch.consoleLog( "info", "DISA.lua Collected: " ..
digits .. "\n" <br>
);<br>
originate_string =<br>
"{ignore_early_media=true" ..<br>
",origination_caller_id_number=" ..
session:getVariable("caller_id_n<br>
umber") ..<br>
",originate_timeout=90" ..<br>
-- ",uuid=" .. session:get_uuid() ..<br>
"}" ..<br>
"sofia/ipbx/" .. session:getVariable("v_ats_srcport") ..
"#" ..<br>
digits .. "@<a href="http://192.168.1.1:5060" target="_blank">192.168.1.1:5060</a>";<br>
<br>
originate_session = freeswitch.Session( originate_string,
session );<br>
<br>
session:setAutoHangup( false );<br>
originate_session:setAutoHangup( false );<br>
<br>
if( originate_session:ready() ) then<br>
<br>
freeswitch.bridge(session, originate_session);<br>
-- originate_session:hangup();<br>
end<br>
end<br>
end<br>
<br>
local digits = "";<br>
<br>
disa();<br>
<br>
if( session:ready() ) then<br>
session:hangup();<br>
end<br>
<br>
<br>
The extension where originate is placed:<br>
<extension name="ext_domestic_e164"><br>
<condition field="destination_number"
expression="^(7[0-9]{10})$"><br>
<action application="log" data="NOTICE [top.ctx] -
ext_domestic"/><br>
<action application="set"
data="hangup_after_bridge=true"/><br>
<action application="set"
data="continue_on_fail=false"/><br>
<action application="set"
data="failure_causes=USER_BUSY,NO_ANSWER"/><br>
<action application="set"
data="fail_on_single_reject=true"/><br>
<!-- Least Cost Routing scheme --><br>
<action application="lcr" data="$1 lcr_tagnet"/><br>
<action application="set" data="call_timeout=60"/><br>
<action application="set"
data="bridge_answer_timeout=60"/><br>
<action application="bridge"
data="${lcr_auto_route}"/><br>
<action application="hangup"/><br>
</condition><br>
</extension><br>
<br>
<blockquote type="cite">
<p>Try harder..</p>
<div class="gmail_quote">On Jul 15, 2011 4:43 AM, "Boris
Kovalenko" <<a href="mailto:boris@tagnet.ru" target="_blank">boris@tagnet.ru</a>> wrote:<br type="attribution">
> Hello!<br>
> <br>
> I tried, no success.<br>
> <br>
>> after you create it<br>
>><br>
>> session:setAutoHangup(0)<br>
>><br>
>> or it will hangup when the script exits<br>
>><br>
>> On Thu, Jul 14, 2011 at 1:11 PM, Boris Kovalenko<<a href="mailto:boris@tagnet.ru" target="_blank">boris@tagnet.ru</a>>
wrote:<br>
>>> Hello!<br>
>>><br>
>>> Here it is <a href="http://pastebin.freeswitch.org/16809" target="_blank">http://pastebin.freeswitch.org/16809</a><br>
>>> Hope somebody help<br>
>>><br>
>>> get a console log w/ siptrace of that scenario and
put it on pastebin. the<br>
>>> gang here will take a look.<br>
>>> -MC<br>
>>><br>
>>> On Thu, Jul 14, 2011 at 10:39 AM, Boris
Kovalenko<<a href="mailto:boris@tagnet.ru" target="_blank">boris@tagnet.ru</a>> wrote:<br>
>>>> And another problem found. If the remote party
answers immediately all<br>
>>>> is ok. But if remote waits more then 8-10
seconds before answer - the<br>
>>>> call is dropped when answered. Can't understand
where to look for a<br>
>>>> problem.<br>
>>>>> Hello!<br>
>>>>><br>
>>>>> I found a problem. originate_session must
not to be local.<br>
>>>>>> Hello!<br>
>>>>>><br>
>>>>>> I'm trying to migrate DISA from
Javascript to LUA. This peace of<br>
>>>>>> code works fine in Javascript:<br>
>>>>>><br>
>>>>>> ostr = "{ignore_early_media=true" +<br>
>>>>>> ",origination_caller_id_number=" +<br>
>>>>>> session.getVariable("caller_id_number")
+<br>
>>>>>> "}sofia/ipbx/50004#" + digits +<br>
>>>>>> "@<a href="http://192.168.1.1:5060" target="_blank">192.168.1.1:5060</a>";<br>
>>>>>> osession = new Session( ostr );<br>
>>>>>> bridge(session, osession);<br>
>>>>>> osession.hangup();<br>
>>>>>><br>
>>>>>> With LUA not:<br>
>>>>>> originate_string =<br>
>>>>>> "{ignore_early_media=true" ..<br>
>>>>>> ",origination_caller_id_number=" ..<br>
>>>>>> session:getVariable("caller_id_number")
..<br>
>>>>>> "}" ..<br>
>>>>>> "sofia/ipbx/50004#" ..<br>
>>>>>> digits .. "@<a href="http://192.168.1.1:5060" target="_blank">192.168.1.1:5060</a>";<br>
>>>>>> originate_session = freeswitch.Session(
originate_string );<br>
>>>>>> freeswitch.bridge(session,
originate_session);<br>
>>>>>> originate_session:hangup();<br>
>>>>>><br>
>>>>>> The call is droped when remote answers.
There is an error in log:<br>
>>>>>> bridge: session not ready. I tried to
use<br>
>>>>>> if( originate_session:ready() ) then<br>
>>>>>> freeswitch.bridge(session,
originate_session);<br>
>>>>>> originate_session:hangup();<br>
>>>>>> end<br>
>>>>>><br>
>>>>>> with no luck :(. Please, help me. What
am I doing wrong?<br>
>>>>>><br>
>>>><br>
>>>> --<br>
>>>> Regards,<br>
>>>> Boris<br>
>>>><br>
>>>><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> Join us at ClueCon 2011, Aug 9-11, Chicago<br>
>>>> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>
877-7-4ACLUE<br>
>>>><br>
>>>> FreeSWITCH-users mailing list<br>
>>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>
>>><br>
>>> _______________________________________________<br>
>>> Join us at ClueCon 2011, Aug 9-11, Chicago<br>
>>> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>
877-7-4ACLUE<br>
>>><br>
>>> FreeSWITCH-users mailing list<br>
>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>
>>><br>
>>> --<br>
>>> Regards,<br>
>>> Boris<br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Join us at ClueCon 2011, Aug 9-11, Chicago<br>
>>> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>
877-7-4ACLUE<br>
>>><br>
>>> FreeSWITCH-users mailing list<br>
>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>
>>><br>
>><br>
>><br>
> <br>
> <br>
> -- <br>
> Regards,<br>
> Boris<br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> Join us at ClueCon 2011, Aug 9-11, Chicago<br>
> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>
877-7-4ACLUE<br>
> <br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
Join us at ClueCon 2011, Aug 9-11, Chicago
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE
FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
</blockquote>
<br>
<br>
<pre cols="72">--
Regards,
Boris
</pre>
</div>
<br>_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<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>