Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ximik777

Pages: [1]
1
Yate bugs / Re: Javascript route gwout
« on: May 29, 2013, 10:33:39 AM »
It was possible to solve the problem as follows.
Add the parameter "domain"

message.caller = '0041817436';
message.line = "sipnet";
message.domain = 'sipnet.ru';
Channel.callJust("sip/sip:"+message.called+'@sipnet.ru:5060');

2
Yate bugs / Re: Javascript route gwout
« on: May 29, 2013, 08:47:48 AM »
Hi!
Thanks for the answer, but does not work.
If I clean caller on line "From" substituted "anonimus".
I think that's not the problem.
I think the problem is that when a call comes through "regexroute.conf" line looks like
"From: <sip:0041817436@sipnet.ru:5060>; tag = 289999931"
"Call-ID: 982755624@sipnet.ru: 5060"
and via JavaScript
"From: <sip:0041817436@91.142.81.148>; tag = 43446094"
"Call-ID: 1389324428@91.142.81.148"

"sipnet.ru" - this is an external line and the
"91.142.81.148" - this is my ip address

I do not understand how to change the host via JavaScript address in these fields.

3
Yate bugs / Javascript route gwout
« on: May 28, 2013, 07:06:23 AM »
Hello!
I'm trying to send a call to an outside line means javascript.
When I turn the call over regexroute.conf - all good.

regexroute.conf
^\(.*\)$=sip/sip:\1;line=sipnet;caller;callername

When I turn the call via JavaScript - all bad.
message.caller = "0041817436";
message.line = "sipnet";
Channel.callJust("sip/sip:"+message.called); // or Channel.callJust("line/"+message.called);

I noticed a difference between calling through regexroute.conf via JavaScript:

regexroute.conf
INVITE sip:79041234567@sipnet.ru:5060 SIP/2.0
/*blablabla*/
From: <sip:0041817436@sipnet.ru:5060>;tag=289999931
/*blablabla*/
Call-ID: 982755624@sipnet.ru:5060

------
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 91.142.81.148:5060;rport=5060;branch=z9hG4bK687133507
From: <sip:0041817436@sipnet.ru:5060>;tag=289999931
To: <sip:79041234567@sipnet.ru:5060>
Call-ID: 982755624@sipnet.ru:5060
CSeq: 4 INVITE
Server: CommuniGatePro/6.0.4
Content-Length: 0


JavaScript
INVITE sip:79041234567@sipnet.ru:5060 SIP/2.0
/*blablabla*/
From: "701" <sip:0041817436@91.142.81.148>;tag=43446094
/*blablabla*/
Call-ID: 1389324428@91.142.81.148

------
SIP/2.0 500 account has been moved to a remote system
Via: SIP/2.0/UDP 91.142.81.148:5060;rport=5060;branch=z9hG4bK632837736
From: "701" <sip:0041817436@91.142.81.148>;tag=43446094
To: <sip:79041234567@sipnet.ru:5060>;tag=6E04F49F
Call-ID: 1389324428@91.142.81.148
CSeq: 4 INVITE
Server: CommuniGatePro/6.0.4
Content-Length: 0

Tell me please, what am I doing wrong?



4
Yate bugs / Javascript bugs
« on: February 06, 2013, 07:15:12 AM »
Hello I found several errors in the javascript.
Yete 4.2.0

var a = '700'; var b = '702';
    var c = [a, b];
    Engine.print_r(c);
    //log
    'c' = '[object Array]' (JsArray)
    'freeze' = '[function freeze()]' (ExpFunction)
    'isFrozen' = '[function isFrozen()]' (ExpFunction)
    'toString' = '[function toString()]' (ExpFunction)
    'hasOwnProperty' = '[function hasOwnProperty()]' (ExpFunction)
    'push' = '[function push()]' (ExpFunction)
    'pop' = '[function pop()]' (ExpFunction)
    'concat' = '[function concat()]' (ExpFunction)
    'join' = '[function join()]' (ExpFunction)
    'reverse' = '[function reverse()]' (ExpFunction)
    'shift' = '[function shift()]' (ExpFunction)
    'unshift' = '[function unshift()]' (ExpFunction)
    'slice' = '[function slice()]' (ExpFunction)
    'splice' = '[function splice()]' (ExpFunction)
    'sort' = '[function sort()]' (ExpFunction)
    'length' = '2' (NamedString)
    '0' = '' (ExpOperation)
    '1' = '' (ExpOperation)

or

function test(a)
{
   Engine.print_r(a);
}

test([message.caller, message.called]);

working only

var a = [];
a.push(message.caller);
a.push(message.called);


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--==-=-

not working "else if(...)"
<JsCode:WARN> Evaluator error: Expecting operand in line "line" at: }

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=

not working function "join"

var a = ['a','b','c'];
a.join();
result 'a,b,c'; good!

a.join(' + ');
result 'abc' not good =(



5
Yate IVR / Re: Javascript + DTMF
« on: February 06, 2013, 07:01:54 AM »
a simple example


function CallRoute(msg)
{
        msg.retValue("dumb/");
        var ca = new Message('call.answered');
        ca['id'] = msg['id'];
        ca['targetid'] = msg['id'];
        ca.enqueue();

        function ChanDtmf(dmsg)
       {
            if(dmsg.text == 5)
            {
               // your code
            }

       }
        Message.install(ChanDtmf, "chan.dtmf", 90);
}
Message.install(CallRoute, 'call.route', 100);

Pages: [1]