If i a get a hangup cause into some variable then i can do some routing depending upon that hangup-cause, <br><br>if (session:ready()) then<br> session:streamFile("/usr/local/freeswitch/sounds/en/us/callie/zrtp/8000/zrtp-somethings_wrong.wav")<br>
<br> disposition = session:getVariable("hangup_cause")<br> freeswitch.consoleLog("info","Hangup cause = " .. disposition .. "\n")<br> disposition = session:hangupCause()<br>
freeswitch.consoleLog("info","Hangup cause = " .. disposition .. "\n")<br><br>then using the "disposition" i can do the routing by if ... then ...<br><br>after executing getting below logs :-<br>
<br>2010-12-18 10:34:55.581403 [ERR] mod_lua.cpp:182 /usr/local/freeswitch/scripts/hello.lua:29: attempt to concatenate global 'disposition' (a nil value)<br>stack traceback:<br> /usr/local/freeswitch/scripts/hello.lua:29: in main chunk<br>
<br><br>Regds<br>Sam<br><br><div class="gmail_quote">On Sat, Dec 18, 2010 at 6:26 AM, mercutioviz [via freeswitch-users] <span dir="ltr"><<a href="mailto:ml-node%2B5847277-1438596481-292429@n2.nabble.com">ml-node+5847277-1438596481-292429@n2.nabble.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
        It depends on what you want to do with the call in the case that the other end does not answer. If you are doing some sort of billing then STOP! Don't do that. Do your billing offline via CDRs or use api_hangup_hook.<div>
<br></div><div>If you just want to send the call to an alternate destination then you need to look at the bridge app on the wiki, specifically for doing pipe-separated lists of dialstrings:</div><div><a href="http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridge#Description" rel="nofollow" link="external" target="_blank">http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridge#Description</a></div>
<div><br></div></div><div>-MC<br><br><div class="gmail_quote"><div class="im">On Fri, Dec 17, 2010 at 2:17 AM, Sam <span dir="ltr"><<a href="http://user/SendEmail.jtp?type=node&node=5847277&i=0" rel="nofollow" target="_blank">[hidden email]</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;"><div class="im">
Thanx Nazim it was of great help,<br><br>i used the below syntax <br><br></div>session:execute("bridge",(string.format("{ignore_early_media='true',continue_on_fail='true'}sofia/external/%<a href="http://user/SendEmail.jtp?type=node&node=5847277&i=1" rel="nofollow" target="_blank">[hidden email]</a>",tostring(digits) )) ) ;<div class="im">
<br>
<br>I am now checking out if i can use hangup causes for routing the call <br><br>LCause = session:hangupCause() ;<br> <br>freeswitch.consoleLog("info", "hangupcause: ".. LCause .." );<br><br>
then if i can use if then else statement for routing ... like <br>
<br>if ( LCause == "NO_USER_RESPONSE" ) then <br> session:transfer(tostring(digits), "XML", "8888")<br><br>how is the idea ?<br><br>Regds</div><div><div></div><div><br>
<br><br><br><div class="gmail_quote"><div class="im">
On Fri, Dec 17, 2010 at 2:39 PM, Nazim Aghabayov <span dir="ltr"><<a href="http://user/SendEmail.jtp?type=node&node=5847277&i=2" rel="nofollow" target="_blank">[hidden email]</a>></span> wrote:<br></div><blockquote class="gmail_quote" style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;">
<div class="im">
Hello! You may try something like:<br>
<br>
session:execute("bridge",<br>
(string.format("{ignore_early_media='true',<br>
ringback='home/app/sounds/ringback-alaw.wav',<br>
transfer_ringback='/home/app/sounds/ringback-alaw.wav',<br>
hangup_after_bridge='true',<br></div>
continue_on_fail='true'}<a href="http://user/SendEmail.jtp?type=node&node=5847277&i=3" rel="nofollow" target="_blank">[hidden email]</a>",<div class="im"><br>
tostring(did) )) )<br>
<br>
There are a lot of nice examples in lua&dialplan wiki pages.<br>
</div><div><div></div><div><div class="im"><br>
On 12/17/2010 12:24 PM, David Ponzone wrote:<br>
> You need to read the wiki intensively, and also, Internet is a very useful source of information to learn LUA.<br>
><br>
> David Ponzone Direction Technique<br></div>
> email: <a href="http://user/SendEmail.jtp?type=node&node=5847277&i=4" rel="nofollow" target="_blank">[hidden email]</a><div><div></div><div class="h5"><br>
> tel: 01 74 03 18 97<br>
> gsm: 06 66 98 76 34<br>
><br>
> Service Client IPeva<br>
> tel: 0811 46 26 26<br>
> <a href="http://www.ipeva.fr" rel="nofollow" link="external" target="_blank">www.ipeva.fr</a> - <a href="http://www.ipeva-studio.com" rel="nofollow" link="external" target="_blank">www.ipeva-studio.com</a><br>
><br>
> Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur.<br>
><br>
><br>
><br>
><br>
> Le 17/12/2010 à 09:07, samir a écrit :<br>
><br>
>> Hello Nazim,<br>
>><br>
>> When i use originate command it gives me below error :-<br>
>><br>
>> 2010-12-17 13:29:30.964039 [ERR] mod_lua.cpp:182 Error in originate expected 4..4 args, got 1<br>
>> stack traceback:<br>
>> [C]: in function 'originate'<br>
>> /usr/local/freeswitch/scripts/hello.lua:14: in main chunk<br>
>><br>
>> I am using<br>
>><br>
>> digits = session:getDigits(5, "#", 3000);<br>
>> freeswitch.consoleLog("info", "Got dtmf: ".. digits .."\n");<br>
>> session.originate("sofia/external/(digits)@<a href="http://192.168.2.3" rel="nofollow" link="external" target="_blank">192.168.2.3</a>");<br>
>><br>
>><br>
>> any idea why is it ?<br>
>><br>
>> Regards<br>
>> Sam<br>
>><br>
>><br>
>> On Fri, Dec 17, 2010 at 4:17 AM, Nazim Aghabayov [via freeswitch-users] <[hidden email]> wrote:<br>
>> Why not using Lua script? Lua is quite powerful and you could benefit of<br>
>> using the luasql for db connectivity.<br>
>><br>
>> g_caller_id = session:getVariable("caller_id_number")<br>
>> g_caller_destination_number = session:getVariable("destination_number")<br>
>> g_caller_context = session:getVariable("context")<br>
>> g_caller_uuid = session:getVariable("uuid")<br>
>> ...<br>
>> session:flushDigits()<br>
>> digits = session:playAndGetDigits(4, 4, 3, 3000, "#",<br>
>> wav_base .. langId .. "/" .. prompt_wav, "",<br>
>> "[" .. allowed_digit1 .. "," .. allowed_digitN .. "]");<br>
>> ...<br>
>> session:transfer(tostring(dest_ext), "XML", "public")<br>
>><br>
>> Regards,<br>
>> Nazim<br>
>><br>
>><br>
>> On 12/16/2010 07:29 AM, Sam wrote:<br>
>><br>
>>> hi,<br>
>>><br>
>>> Its not an XML IVR but trying to collect digits when the user punches in<br>
>>> some digits after a playback sound file,<br>
>>> so that the digits would get stored into $(digits) and i can use those<br>
>>> digits for further processing or transferring<br>
>>> to other dial-plan as per the digits punched in.<br>
>>><br>
>>> Suppose a digits punched are 4567, I collect them in $(digits) and by<br>
>>> transfer function i do the transfer.<br>
>>><br>
>>> <action application="transfer" data="$(digits) default XML"/><br>
>>><br>
>>> -----------------------------------------------------------------------------------------------<br>
>>><br>
>>> Also i could see that in IVR.conf can do this by pressing 4567 and executing<br>
>>> a statement , but here also question<br>
>>> is how can i use it by storing those collected digits in an variable and the<br>
>>> using it further.<br>
>>><br>
>>> ----------------------------------------------------------------------------------------------<br>
>>><br>
>>> I was thinking how in both the cases it could be done.<br>
>>><br>
>>> Thnx & Regds<br>
>>> Sam<br>
>>><br>
>>><br>
>>><br>
>>> On Thu, Dec 16, 2010 at 4:35 AM, Michael Collins <[hidden email]> wrote:<br>
>>><br>
>>>> Is this an XML IVR?<br>
>>>> -MC<br>
>>>><br>
>>>><br>
>>>> On Tue, Dec 14, 2010 at 1:43 AM, samir <[hidden email]> wrote:<br>
>>>>> hello,<br>
>>>>><br>
>>>>> Is there any method to collect digits by a variable clause ?<br>
>>>>><br>
>>>>> Suppose i have a ivr playing and user inputs digits , i want to collect<br>
>>>>> the<br>
>>>>> dtmf digits and send it to a different application where that digits will<br>
>>>>> be<br>
>>>>> used for routing purpose.<br>
>>>>><br>
>>>>> Any ideas !<br>
>>>>><br>
>>>>> Regards<br>
>>>>> Sam<br>
>>>>> --<br>
>>>>> View this message in context:<br>
>>>>> <a href="http://freeswitch-users.2379917.n2.nabble.com/collecting-dtmf-digits-tp5833942p5833942.html?by-user=t" rel="nofollow" link="external" target="_blank">http://freeswitch-users.2379917.n2.nabble.com/collecting-dtmf-digits-tp5833942p5833942.html</a><br>
>>>>> Sent from the freeswitch-users mailing list archive at Nabble.com.<br>
>>>>><br>
>>>>> _______________________________________________<br>
>>>>> FreeSWITCH-users mailing list<br>
>>>>> [hidden email]<br>
>>>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>>>>> <a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
>>>>><br>
>>>> _______________________________________________<br>
>>>> FreeSWITCH-users mailing list<br>
>>>> [hidden email]<br>
>>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>>>> <a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
>>>><br>
>>>><br>
>>><br>
>>> _______________________________________________<br>
>>> FreeSWITCH-users mailing list<br>
>>> [hidden email]<br>
>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>>> <a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
>><br>
>> _______________________________________________<br>
>> FreeSWITCH-users mailing list<br>
>> [hidden email]<br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
>><br>
>><br>
>> View message @ <a href="http://freeswitch-users.2379917.n2.nabble.com/collecting-dtmf-digits-tp5833942p5843837.html?by-user=t" rel="nofollow" link="external" target="_blank">http://freeswitch-users.2379917.n2.nabble.com/collecting-dtmf-digits-tp5833942p5843837.html</a><br>
>><br>
>> To unsubscribe from collecting dtmf digits, click here.<br>
>><br>
>><br>
>> View this message in context: Re: collecting dtmf digits<br>
>> Sent from the freeswitch-users mailing list archive at Nabble.com.<br>
>> _______________________________________________<br>
>> FreeSWITCH-users mailing list<br>
>> <a href="http://user/SendEmail.jtp?type=node&node=5847277&i=5" rel="nofollow" target="_blank">[hidden email]</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
><br>
><br>
> _______________________________________________<br>
> FreeSWITCH-users mailing list<br>
> <a href="http://user/SendEmail.jtp?type=node&node=5847277&i=6" rel="nofollow" target="_blank">[hidden email]</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="http://user/SendEmail.jtp?type=node&node=5847277&i=7" rel="nofollow" target="_blank">[hidden email]</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
</div></div></div></div></blockquote></div><br>
</div></div><div><div></div><div class="h5"><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="http://user/SendEmail.jtp?type=node&node=5847277&i=8" rel="nofollow" target="_blank">[hidden email]</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
<br></div></div></blockquote></div><br></div>
<br>_______________________________________________
<br><div class="im">FreeSWITCH-users mailing list
<br><a href="http://user/SendEmail.jtp?type=node&node=5847277&i=9" rel="nofollow" target="_blank">[hidden email]</a>
<br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="nofollow" link="external" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="nofollow" link="external" target="_blank">http://www.freeswitch.org</a><br>
        <br>
        <br>
        <hr color="#cccccc" noshade size="1">
        </div><div style="color: rgb(102, 102, 102); font: 11px tahoma,geneva,helvetica,arial,sans-serif;">
                View message @ <a href="http://freeswitch-users.2379917.n2.nabble.com/collecting-dtmf-digits-tp5833942p5847277.html" target="_blank">http://freeswitch-users.2379917.n2.nabble.com/collecting-dtmf-digits-tp5833942p5847277.html</a><div class="im">
<br>
                
                To unsubscribe from collecting dtmf digits, <a href="http://freeswitch-users.2379917.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5833942&code=dTJuc2FtQGdtYWlsLmNvbXw1ODMzOTQyfC0xMTk1MzYwMDk5" target="_blank">click here</a>.
        </div></div></blockquote></div><br>