[Freeswitch-users] stop sip_info

Sharad Garg sharad at coraltele.com
Fri Feb 17 08:49:23 MSK 2012


Hi Brian

This is Sharad, coligue of Piyush...

Hope you are recovering fast at Hospital. I wish you get well soon. praying for your Good Health.

Now let me just explain the case from begining. - 

 a) We have written a very very basic Javascript to handle an incoming call. 
b)  When call comes, XML dialplan invokes the Javascript.
c)  Javascript plays first prompt & expects some input from the caller. 
d)  Caller can dial either in DTMF / Sip Info / RFC 2833.
e) When caller punches some digit, Javascript just detects the input & a debug is printed 'You Entered = 12".
f) Now Javascript moves to next etep & plays second prompt. 
g) While JS plays the second prompt, no input (if caller enters either in DTMF / Sip Info / RFC2833) should be detected. Means before playing second prompt, JS should disable the input detection.

This is what we want. Hope it is clear.

But the issue is - It works fine when caller dials in DTMF. But when caller dials the digit either in Sip_Info / Rfc2833, freeswitch is detecting the digit during second prompt also. We want to know where we are wrong. How can we disable the SIP_Info / RFC2833 detection during second prompt.


Now let me show what we have defined -

====================================================================
Our XML dialplan is like this -

<extension name="Digit detection ">
<condition field="destination_number" expression="^(3333)$">
    <!--<action application="set" data="bypass_media=true"/>-->
    <action application="stop_dtmf"/>
    <action application="start_dtmf"/>
    <action application="set" data="continue_on_fail=true"/>
    <action application="answer"/>
    <action application="sleep" data="100"/>
    <action application="javascript" data="sip_test.js 00 3333"/>
</condition>
</extension>
=======================================================================

=======================================================================
Javascript is -
//var saved_digts="";
var dtmf="";
var stop_dtmf=false;
var dtmf_digits="";

function on_dtmf(session,type,digits,arg)
{
        if(saved_digits = session.getVariable("digits"))
                session.setVariable("digits",saved_digits + digits.digit);
        else
        {
                session.setVariable("digits",digits.digit);
                dtmf = session.getDigits(10,"#",inter_digit_timeout);
                session.setVariable("digits",session.getVariable("digits") + dtmf);
        }
        stop_dtmf = true;
        return false;
}

function main()
{
 session.streamFile("ivr/coral_welcom_deepawali.wav",on_dtmf);
        while(dtmf_digits=="")
 {
  if(!stop_dtmf)
   session.collectInput(on_dtmf,dtmf,"5" );
  if(stop_dtmf)
   dtmf_digits=session.getVariable("digits");
 }
 console_log("INFO","You Entered = "+dtmf_digits+"\n");
 session.execute("stop_dtmf");
 session.streamFile("ivr/coral_welcom_deepawali.wav");
 session.hangup();
}

main();
==========================================================================

If you need any other information related to this, plz do let me know.

Regards
Sharad







  ----- Original Message ----- 
  From: Brian West 
  To: FreeSWITCH Users Help 
  Sent: Thursday, February 16, 2012 7:18 PM
  Subject: Re: [Freeswitch-users] stop sip_info


  This is your phones fault.  Notice in the SDP it doesn't negotiate telephoney-event so we have nothing to clue us in on that it does 2833 or info.  So in reality you should go beat the creator of this phone to death for not doing something about this.  (btw info draft expired and IS NOT a standard).


  BUT you can relax now..  set the sofia profile option 'liberal-dtmf' to true.... NEXT!!!


  /b
  PS: BKW-1 updated with latest info.


  On Feb 16, 2012, at 6:11 AM, Piyush Sharma wrote:



    Thanks for Response Michael,
    This is the capture of wireshark

    INVITE sip:3333 at 192.168.4.18:5060 SIP/2.0
    Via: SIP/2.0/UDP 192.168.4.244:5065;branch=z9hG4bK9268238112493813801;rport
    From: 30000 <sip:30000 at 192.168.4.18:5060>;tag=1653316119
    To: "3333" <sip:3333 at 192.168.4.18:5060>
    Call-ID: 188371401128256-63249236018 at 192.168.4.244
    CSeq: 1 INVITE
    Contact: <sip:30000 at 192.168.4.244:5065>
    Max-Forwards: 70
    Supported: replaces, join, path
    User-Agent: Voip Phone 1.0
    Allow: INVITE, ACK, OPTIONS, BYE, CANCEL, REFER, NOTIFY, INFO, PRACK, UPDATE, MESSAGE
    Content-Type: application/sdp
    Content-Length: 185

    v=0
    o=30000 24630637 15149730 IN IP4 192.168.4.244
    s=A conversation
    c=IN IP4 192.168.4.244
    t=0 0
    m=audio 10006 RTP/AVP 8 0
    a=rtpmap:8 PCMA/8000
    a=rtpmap:0 PCMU/8000
    a=sendrecv


  -- 
  Brian West 
  FreeSWITCH Solutions, LLC
  Phone: +1 (918) 420-9266 
  Fax:   +1 (918) 420-9267
  brian at freeswitch.org
  http://www.freeswitch.org 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120217/8c978f88/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list