Author Topic: Javascript route gwout  (Read 12628 times)

ximik777

  • Newbie
  • *
  • Posts: 5
    • View Profile
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?



marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Javascript route gwout
« Reply #1 on: May 29, 2013, 01:37:15 AM »
Hi,
In regexroute you clear the caller and callername parameters when routing.
Do the same in javascript.

ximik777

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Javascript route gwout
« Reply #2 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.

ximik777

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Javascript route gwout
« Reply #3 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');