Re: [SR-Users] FW: Kamailio as sipRedirect

2012-09-07 Thread Daniel-Constantin Mierla

  
  
Hello,

this is a static string: ”sip:.*@192.168.111.138"

It means you redirect any number to '.*'.

To preserve the incoming number, use:

$ru = "sip:" + $rU + "@192.168.111.138";

Cheers,
Daniel

On 9/6/12 3:40 PM, Fatima
  Chahrour~Vanrise Support wrote:


  
  
  
  
  
Dear Daniel,
 
Attached is my
config file.
Is it correct
to set $ru=”sip:.*@192.168.111.138";
in case I need any number to be redirected to
192.168.111.138.
 
Thanks.
 

  
From:
sr-users-boun...@lists.sip-router.org
[mailto:sr-users-boun...@lists.sip-router.org] On
  Behalf Of Fatima Chahrour~Vanrise Support
Sent: Wednesday, September 05, 2012 5:19 PM
To: mico...@gmail.com
Cc: 'SIP Router - Kamailio (OpenSER) and SIP
Express Router (SER) - Users Mailing List'
            Subject: Re: [SR-Users] FW: Kamailio as
sipRedirect
  

 

  Hi Daniel,
   

The call is not
redirected to 1st kamailio, below is the call
trace where 2nd  kamailio(192.168.111.139) send
request to 192.168.111.15 which is the gateway in the lcr
rule instead of sending this invite to 192.168.111.138.
 
U 192.168.111.139:5060 -
192.168.111.15:5060 (shouldn’t
this be 192.168.111.138:5060 instead??)
INVITE sip:22#96135050@192.168.111.15
SIP/2.0.
Record-Route:
sip:192.168.111.139;lr=on.
Record-Route:
sip:192.168.111.138;lr=on.
Via: SIP/2.0/UDP
192.168.111.139;branch=z9hG4bK5757.5b3b1975.0.
Via: SIP/2.0/UDP
192.168.111.138;branch=z9hG4bK5757.50ff9264.0.
Via: SIP/2.0/UDP
192.168.52.139:12650;received=192.168.111.11;branch=z9hG4bK-d8754z-85008205ba3ea607-1---d8754z-;rport=12650.
Max-Forwards: 68.
Contact:
sip:106@192.168.111.11:12650.
To:
"96135050"sip:96135050@192.168.111.138.
From:
"106"sip:106@192.168.111.138;tag=56645478.
Call-ID:
ZjJlYWYzZmJmYmJlMGE0MmYxYWUwYjYwZmY5MmJkMjg..
CSeq: 1 INVITE.
Allow: INVITE, ACK, CANCEL, OPTIONS,
BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO.
Content-Type: application/sdp.
User-Agent: X-Lite release 1100l stamp
47546.
Content-Length: 477.
 
This is my
Kamailio routing logic configured on the 1st Kamailio to
forward any call from 1st kamialio to 2nd
kamailio:
 
if
(is_method("INVITE"))
{
Sethostport(“192.168.111.139:5060”);
Append_branch();
}
 
My problem is
hereà This is my Kamailio routing
configured on 2nd kamailio which I want from it
to send back the call, with lcr_gateway already defined, to
1st Kamailio:
 
if
(is_method("INVITE"))
   
{
   
  if (!load_gws("1")) {
   
  sl_send_reply("503", "Unable to load gateways");
   
  exit;
   
   }
   
  if(!next_gw()){
   
  sl_send_reply("503", "Unable to find a gateway");
   
  exit;}
   

   
  route(1);
 
   
  $ru="sip:.*@192.168.111.138";
   
  send_reply("302","rEdIrEcTeD");
   
   km_append_branch("uri");
}
 
Am looking
through many documents but can’t achieve my target, I want
the 2nd Kamailio, which has LCR configured on it,
to send back to 1st Kamailio the gateway from
lcr_gateways with 302 redirect message.
 
My questions
are:
How to achieve
this? 
Do you suggest
any document that help?
Do I need to
load any specific module?
 
Thanks,
F Chahrour
 

  
From:
Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: Wednesday, September 05, 2012 9:38 AM
 

Re: [SR-Users] FW: Kamailio as sipRedirect

2012-09-07 Thread Daniel-Constantin Mierla

  
  
Hello,

On 9/6/12 6:47 PM, Fatima
  Chahrour~Vanrise Support wrote:


  
  
  
  
  
Hi again,
 
I really need
your help in my testing lab here!!
I have
simplified the scenario and changed configs to make it easy
pinpoint the redirect issue and then apply on my real
scenario:
 
Two
Phones(username: 106 and 107) registered on Kamailio1
(192.168.111.138). 
- 
  Phone   106: dial 107  àOK
- 
  Kamailio routing forward call to
Kamailio2(192.168.111.139) àOK
- 
  Then Kamailio should only receive the
call from Kamailio1 and redirect it back to Kamailio1 àNOT OK
Note: In my real scenario Kamailio 2
will be responsible for taking the routing decision based on
its defined LCR rules and redirect the call with rewritten
uri to Kamailio1.
 
Setting in
Kamailio2 routing script the following is not working till
now:
 
$ru = "sip:107@192.168.111.138";
send_reply("302", "Redirected");
  
  

the two lines above should be enough for the redirect. I wrote in
another email, to preserve the incoming username, use:

$ru = "sip:" + $rU + "@192.168.111.138";

If it is not working, set debug=3 and watch the log messages (in
/var/log/syslog or /var/log/messages) to understand what is not
configured properly.


  
Km_append_branch(“uri”);
  


This is not necessary and the parameter has to be a valid SIP URI --
you copied the prototype as it is in docs, defining the format of
the function.

Cheers,
Daniel


  

 
Kamailio2 is
not sending the 302 message and this is my problem.
How can I send
the 302 message redirect? And where do I have to place or
put the related function in the script?
 
Thank you.
 
Kind regards,
F.Chahrour
 

  
From:
sr-users-boun...@lists.sip-router.org
[mailto:sr-users-boun...@lists.sip-router.org] On
  Behalf Of Fatima Chahrour~Vanrise Support
Sent: Thursday, September 06, 2012 4:40 PM
To: 'SIP Router - Kamailio (OpenSER) and SIP
Express Router (SER) - Users Mailing List';
        mico...@gmail.com
    Subject: Re: [SR-Users] FW: Kamailio as
sipRedirect
  

 
Dear Daniel,
 
Attached is my
config file.
Is it correct
to set $ru=”sip:.*@192.168.111.138"; in case I need any
number to be redirected to 192.168.111.138.
 
Thanks.
 

  
From:
sr-users-boun...@lists.sip-router.org
[mailto:sr-users-boun...@lists.sip-router.org] On
  Behalf Of Fatima Chahrour~Vanrise Support
Sent: Wednesday, September 05, 2012 5:19 PM
To: mico...@gmail.com
Cc: 'SIP Router - Kamailio (OpenSER) and SIP
Express Router (SER) - Users Mailing List'
Subject: Re: [SR-Users] FW: Kamailio as
sipRedirect
  

 

  Hi Daniel,
   

The call is not
redirected to 1st kamailio, below is the call
trace where 2nd  kamailio(192.168.111.139) send
request to 192.168.111.15 which is the gateway in the lcr
rule instead of sending this invite to 192.168.111.138.
 
U 192.168.111.139:5060 -
192.168.111.15:5060 (shouldn’t
this be 192.168.111.138:5060 instead??)
INVITE sip:22#96135050@192.168.111.15
SIP/2.0.
Record-Route:
sip:192.168.111.139;lr=on.
Record-Route:
sip:192.168.111.138;lr=on.
Via: SIP/2.0/UDP
192.168.111.139;branch=z9hG4bK5757.5b3b1975.0.
Via: SIP/2.0/UDP
192.168.111.138;branch=z9hG4bK5757.50ff9264.0.
Via: SIP/2.0/UDP
192.168.52.139:12650;received=192.168.111.11;branch=z9hG4bK-d8754z-85008205ba3ea607-1---d8754z-;rport=12650.
Max-Forwards: 68.
Contact:
sip:106@192.168.111.11:12650.
To:
"96135050"sip:96135050@192.168.111.138.
From:
"106"sip:106@192.168.111.138;tag=56645478.
Call-ID:
ZjJlYWYzZmJmYmJlMGE0MmYxYWUwYjYwZmY5MmJkMjg..
CSeq: 1 INVITE.
Allow: INVITE, ACK

Re: [SR-Users] FW: Kamailio as sipRedirect

2012-09-07 Thread Fatima Chahrour~Vanrise Support
Hello,

 

Not working, I have attached the syslogOnKamailio2-.139.txt generated after a 
test call from 106 dialing 107.

It shows: No Route headers found and '107' Not found in usrloc; what does this 
means? And is it related?

 

Waiting your feedback.

 

Kind regards,

F Chahrour

From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: Friday, September 07, 2012 10:33 AM
To: Fatima Chahrour~Vanrise Support
Cc: 'SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users 
Mailing List'
Subject: Re: [SR-Users] FW: Kamailio as sipRedirect

 

Hello,

On 9/6/12 6:47 PM, Fatima Chahrour~Vanrise Support wrote:

Hi again,

 

I really need your help in my testing lab here!!

I have simplified the scenario and changed configs to make it easy pinpoint the 
redirect issue and then apply on my real scenario:

 

Two Phones(username: 106 and 107) registered on Kamailio1 (192.168.111.138). 

-  Phone   106: dial 107  àOK

-  Kamailio routing forward call to Kamailio2(192.168.111.139) àOK

-  Then Kamailio should only receive the call from Kamailio1 and 
redirect it back to Kamailio1 àNOT OK

Note: In my real scenario Kamailio 2 will be responsible for taking the routing 
decision based on its defined LCR rules and redirect the call with rewritten 
uri to Kamailio1.

 

Setting in Kamailio2 routing script the following is not working till now:

 

$ru = sip:107@192.168.111.138;
send_reply(302, Redirected);

the two lines above should be enough for the redirect. I wrote in another 
email, to preserve the incoming username, use:

$ru = sip: + $rU + @192.168.111.138;

If it is not working, set debug=3 and watch the log messages (in 
/var/log/syslog or /var/log/messages) to understand what is not configured 
properly.




Km_append_branch(“uri”);


This is not necessary and the parameter has to be a valid SIP URI -- you copied 
the prototype as it is in docs, defining the format of the function.

Cheers,
Daniel




 

Kamailio2 is not sending the 302 message and this is my problem.

How can I send the 302 message redirect? And where do I have to place or put 
the related function in the script?

 

Thank you.

 

Kind regards,

F.Chahrour

 

 
U 192.168.111.11:24802 - 192.168.111.138:5060
INVITE sip:107@192.168.111.138 SIP/2.0.
Via: SIP/2.0/UDP 
192.168.52.139:24802;branch=z9hG4bK-d8754z-7d54de4dd05afd4b-1---d8754z-;rport.
Max-Forwards: 70.
Contact: sip:106@192.168.111.11:24802.
To: 107sip:107@192.168.111.138.
From: 106sip:106@192.168.111.138;tag=3d091752.
Call-ID: YWUyNTdjYjZhZGZmYmJjMzU0ZGMzNDY1MmFkNWIzNDQ..
CSeq: 1 INVITE.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO.
Content-Type: application/sdp.
User-Agent: X-Lite release 1100l stamp 47546.
Content-Length: 480.
.
v=0.
o=- 4 2 IN IP4 192.168.111.11.
s=CounterPath X-Lite 3.0.
c=IN IP4 192.168.111.11.
t=0 0.
m=audio 22038 RTP/AVP 107 119 100 106 0 105 98 8 3 101.
a=alt:1 2 : Z3LAcUZR tEUZRy5N 192.168.52.139 22038.
a=alt:2 1 : ovb3UWQ7 t62zHtPB 192.168.111.11 22038.
a=fmtp:101 0-15.
a=rtpmap:107 BV32/16000.
a=rtpmap:119 BV32-FEC/16000.
a=rtpmap:100 SPEEX/16000.
a=rtpmap:106 SPEEX-FEC/16000.
a=rtpmap:105 SPEEX-FEC/8000.
a=rtpmap:98 iLBC/8000.
a=rtpmap:101 telephone-event/8000.
a=sendrecv.


U 192.168.111.138:5060 - 192.168.111.11:24802
SIP/2.0 100 trying -- your call is important to us.
Via: SIP/2.0/UDP 
192.168.52.139:24802;branch=z9hG4bK-d8754z-7d54de4dd05afd4b-1---d8754z-;rport=24802;received=192.168.111.11.
To: 107sip:107@192.168.111.138.
From: 106sip:106@192.168.111.138;tag=3d091752.
Call-ID: YWUyNTdjYjZhZGZmYmJjMzU0ZGMzNDY1MmFkNWIzNDQ..
CSeq: 1 INVITE.
Server: kamailio (3.2.4 (i386/linux)).
Content-Length: 0.
.


U 192.168.111.138:5060 - 192.168.111.139:5060
INVITE sip:107@192.168.111.139:5060 SIP/2.0.
Record-Route: sip:192.168.111.138;lr=on.
Via: SIP/2.0/UDP 192.168.111.138;branch=z9hG4bKd1a7.5a3bc762.0.
Via: SIP/2.0/UDP 
192.168.52.139:24802;received=192.168.111.11;branch=z9hG4bK-d8754z-7d54de4dd05afd4b-1---d8754z-;rport=24802.
Max-Forwards: 69.
Contact: sip:106@192.168.111.11:24802.
To: 107sip:107@192.168.111.138.
From: 106sip:106@192.168.111.138;tag=3d091752.
Call-ID: YWUyNTdjYjZhZGZmYmJjMzU0ZGMzNDY1MmFkNWIzNDQ..
CSeq: 1 INVITE.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO.
Content-Type: application/sdp.
User-Agent: X-Lite release 1100l stamp 47546.
Content-Length: 480.
.
v=0.
o=- 4 2 IN IP4 192.168.111.11.
s=CounterPath X-Lite 3.0.
c=IN IP4 192.168.111.11.
t=0 0.
m=audio 22038 RTP/AVP 107 119 100 106 0 105 98 8 3 101.
a=alt:1 2 : Z3LAcUZR tEUZRy5N 192.168.52.139 22038.
a=alt:2 1 : ovb3UWQ7 t62zHtPB 192.168.111.11 22038.
a=fmtp:101 0-15.
a=rtpmap:107 BV32/16000.
a=rtpmap:119 BV32-FEC/16000.
a=rtpmap:100 SPEEX/16000.
a=rtpmap:106 SPEEX-FEC/16000.
a=rtpmap:105 SPEEX-FEC/8000.
a=rtpmap:98 iLBC/8000.
a=rtpmap:101 telephone-event/8000.
a=sendrecv.


U 192.168.111.139:5060 - 192.168.111.138:5060
SIP/2.0 404 Not Found.
Via: SIP/2.0/UDP

Re: [SR-Users] FW: Kamailio as sipRedirect

2012-09-07 Thread Fatima Chahrour~Vanrise Support
Hello,

 

It works now.. It was not an issue in the function you provided but in the 
presence of route(1)  before $ru = sip: + $rU + @192.168.111.138; in the 
script.

And successfully kamailio2 now is able to send the 302 message to .138.

 

Now I’ll work on letting Kamailio1 handle the 302 message in order to make 
successful call.

 

Thank you Daniel very much for your help. 

 

Much appreciated,

F Chahrour

 

From: sr-users-boun...@lists.sip-router.org 
[mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of Fatima 
Chahrour~Vanrise Support
Sent: Friday, September 07, 2012 12:04 PM
To: mico...@gmail.com
Cc: 'SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users 
Mailing List'
Subject: Re: [SR-Users] FW: Kamailio as sipRedirect

 

Hello,

 

Not working, I have attached the syslogOnKamailio2-.139.txt generated after a 
test call from 106 dialing 107.

It shows: No Route headers found and '107' Not found in usrloc; what does this 
means? And is it related?

 

Waiting your feedback.

 

Kind regards,

F Chahrour

From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: Friday, September 07, 2012 10:33 AM
To: Fatima Chahrour~Vanrise Support
Cc: 'SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users 
Mailing List'
Subject: Re: [SR-Users] FW: Kamailio as sipRedirect

 

Hello,

On 9/6/12 6:47 PM, Fatima Chahrour~Vanrise Support wrote:

Hi again,

 

I really need your help in my testing lab here!!

I have simplified the scenario and changed configs to make it easy pinpoint the 
redirect issue and then apply on my real scenario:

 

Two Phones(username: 106 and 107) registered on Kamailio1 (192.168.111.138). 

-  Phone   106: dial 107  àOK

-  Kamailio routing forward call to Kamailio2(192.168.111.139) àOK

-  Then Kamailio should only receive the call from Kamailio1 and 
redirect it back to Kamailio1 àNOT OK

Note: In my real scenario Kamailio 2 will be responsible for taking the routing 
decision based on its defined LCR rules and redirect the call with rewritten 
uri to Kamailio1.

 

Setting in Kamailio2 routing script the following is not working till now:

 

$ru = sip:107@192.168.111.138;
send_reply(302, Redirected);

the two lines above should be enough for the redirect. I wrote in another 
email, to preserve the incoming username, use:

$ru = sip: + $rU + @192.168.111.138;

If it is not working, set debug=3 and watch the log messages (in 
/var/log/syslog or /var/log/messages) to understand what is not configured 
properly.



Km_append_branch(“uri”);


This is not necessary and the parameter has to be a valid SIP URI -- you copied 
the prototype as it is in docs, defining the format of the function.

Cheers,
Daniel



 

Kamailio2 is not sending the 302 message and this is my problem.

How can I send the 302 message redirect? And where do I have to place or put 
the related function in the script?

 

Thank you.

 

Kind regards,

F.Chahrour

 

 
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] FW: Kamailio as sipRedirect

2012-09-06 Thread Fatima Chahrour~Vanrise Support
Hi again,

 

I really need your help in my testing lab here!!

I have simplified the scenario and changed configs to make it easy pinpoint the 
redirect issue and then apply on my real scenario:

 

Two Phones(username: 106 and 107) registered on Kamailio1 (192.168.111.138). 

-  Phone   106: dial 107  àOK

-  Kamailio routing forward call to Kamailio2(192.168.111.139) àOK

-  Then Kamailio should only receive the call from Kamailio1 and 
redirect it back to Kamailio1 àNOT OK

Note: In my real scenario Kamailio 2 will be responsible for taking the routing 
decision based on its defined LCR rules and redirect the call with rewritten 
uri to Kamailio1.

 

Setting in Kamailio2 routing script the following is not working till now:

 

$ru = sip:107@192.168.111.138;
send_reply(302, Redirected);
Km_append_branch(“uri”);

 

Kamailio2 is not sending the 302 message and this is my problem.

How can I send the 302 message redirect? And where do I have to place or put 
the related function in the script?

 

Thank you.

 

Kind regards,

F.Chahrour

 

From: sr-users-boun...@lists.sip-router.org 
[mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of Fatima 
Chahrour~Vanrise Support
Sent: Thursday, September 06, 2012 4:40 PM
To: 'SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users 
Mailing List'; mico...@gmail.com
Subject: Re: [SR-Users] FW: Kamailio as sipRedirect

 

Dear Daniel,

 

Attached is my config file.

Is it correct to set $ru=”sip:.*@192.168.111.138; in case I need any number to 
be redirected to 192.168.111.138.

 

Thanks.

 

From: sr-users-boun...@lists.sip-router.org 
[mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of Fatima 
Chahrour~Vanrise Support
Sent: Wednesday, September 05, 2012 5:19 PM
To: mico...@gmail.com
Cc: 'SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users 
Mailing List'
Subject: Re: [SR-Users] FW: Kamailio as sipRedirect

 

Hi Daniel,

 

The call is not redirected to 1st kamailio, below is the call trace where 2nd  
kamailio(192.168.111.139) send request to 192.168.111.15 which is the gateway 
in the lcr rule instead of sending this invite to 192.168.111.138.

 

U 192.168.111.139:5060 - 192.168.111.15:5060 (shouldn’t this be 
192.168.111.138:5060 instead??)

INVITE sip:22#96135050@192.168.111.15 SIP/2.0.

Record-Route: sip:192.168.111.139;lr=on.

Record-Route: sip:192.168.111.138;lr=on.

Via: SIP/2.0/UDP 192.168.111.139;branch=z9hG4bK5757.5b3b1975.0.

Via: SIP/2.0/UDP 192.168.111.138;branch=z9hG4bK5757.50ff9264.0.

Via: SIP/2.0/UDP 
192.168.52.139:12650;received=192.168.111.11;branch=z9hG4bK-d8754z-85008205ba3ea607-1---d8754z-;rport=12650.

Max-Forwards: 68.

Contact: sip:106@192.168.111.11:12650.

To: 96135050sip:96135050@192.168.111.138.

From: 106sip:106@192.168.111.138;tag=56645478.

Call-ID: ZjJlYWYzZmJmYmJlMGE0MmYxYWUwYjYwZmY5MmJkMjg..

CSeq: 1 INVITE.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO.

Content-Type: application/sdp.

User-Agent: X-Lite release 1100l stamp 47546.

Content-Length: 477.

 

This is my Kamailio routing logic configured on the 1st Kamailio to forward any 
call from 1st kamialio to 2nd kamailio:

 

if (is_method(INVITE))

{

Sethostport(“192.168.111.139:5060”);

Append_branch();

}

 

My problem is hereà This is my Kamailio routing configured on 2nd kamailio 
which I want from it to send back the call, with lcr_gateway already defined, 
to 1st Kamailio:

 

if (is_method(INVITE))

{

  if (!load_gws(1)) {

  sl_send_reply(503, Unable to load gateways);

  exit;

   }

  if(!next_gw()){

  sl_send_reply(503, Unable to find a gateway);

  exit;}



  route(1);

 

  $ru=sip:.*@192.168.111.138;

  send_reply(302,rEdIrEcTeD);

   km_append_branch(uri);

}

 

Am looking through many documents but can’t achieve my target, I want the 2nd 
Kamailio, which has LCR configured on it, to send back to 1st Kamailio the 
gateway from lcr_gateways with 302 redirect message.

 

My questions are:

How to achieve this? 

Do you suggest any document that help?

Do I need to load any specific module?

 

Thanks,

F Chahrour

 

From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: Wednesday, September 05, 2012 9:38 AM
To: Fatima Chahrour~Vanrise Support
Cc: 'SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users 
Mailing List'
Subject: Re: [SR-Users] FW: Kamailio as sipRedirect

 

Hello,
You set r-uri ($ru) to an IP address only -- it has to be a full SIP URI.

Cheers,
Daniel

On 9/4/12 5:34 PM, Fatima Chahrour~Vanrise Support wrote:

Hello,

 

Thanks for your reply.. am able to make the call reach from 3CX to Kamailio 
using the src_ip, thank you, but still not able

Re: [SR-Users] FW: Kamailio as sipRedirect

2012-09-05 Thread Daniel-Constantin Mierla

  
  
Hello,
You set r-uri ($ru) to an IP address only -- it has to be a full SIP
URI.

Cheers,
Daniel

On 9/4/12 5:34 PM, Fatima
  Chahrour~Vanrise Support wrote:


  
  
  
  
  
Hello,
 
Thanks for your
reply.. am able to make the call reach from 3CX to Kamailio
using the src_ip, thank you, but still not able to redirect
the call invite from Kamailio to 3CX and send the 302
message.
 


  

  
  
  
  
  
  
  
  


  
  
  
  
  
  
  

  

  
Kamailio 
192.168.111.139
 
  
  
  

  
 


  
  

  

   

Phone A  (192.168.111.11)
 


  

  
  

  

  
302
  
  
  

  
 

  

  Phone B
(192.168.111.10)
 
Herby what am
putting in my routing:
 
If (is_method("INVITE"))
 
{ if(!load_gateway("1")) {
sl_send_reply("503", "unable to load
  gateways");
Exit;  }
 
{ if(! next_gateway()) {
sl_send_reply("503", "unable to find
  gateways");
Exit;  }
Route(1);
 
$ru = "192.168.111.138";
send_reply("302", "Redirected";
Km_append_branch(“uri”);
Exit;

  
What am I doing
is wrong in the above script? And causing “call failed”!
attached ‘test.txt’ the ngrep capture if needed.
 
Your help is
highly appreciated.
 
Kind Regards,
F Chahrour

  
From:
sr-users-boun...@lists.sip-router.org
[mailto:sr-users-boun...@lists.sip-router.org] On
  Behalf Of Daniel-Constantin Mierla
Sent: Thursday, August 30, 2012 10:56 AM
To: Fatima Chahrour
Cc: SIP Router - Kamailio (OpenSER) and SIP
        Express Router (SER) - Users Mailing List
Subject: Re: [SR-Users] FW: Kamailio as
sipRedirect
  

 
Hello,
  
  if you know the IP address of 3CX, then you can skip
  authentication for that, like:
  
  if(src_ip==__3cx_ip__) {
    # don't do authentication for the traffic coming here
  
  }
  
  You can use permission module to store the a list of ip
  addresses and then use functions from that module to match
  against source ip of requests, as alternative to above,
  providing more flexibility when dealing with lot of trusted ip
  addresses.
  
  Cheers,
  Daniel

  On 8/29/12 9:15 PM, Fatima Chahrour
wrote:


  

  Hello Danial,


   


  Hereby details:


  My current working 1st scenario is a
call generated from A-party x-lite registered on
kamalio, this call is routed based on kamailio lcr
routing module which add prefix and send prefix to 3CX
then 3CX forward the call to B-party x-lite, registered
on 3CX, successfully.


   


  In kamailio.cfg routing logic I only
used :


   


  ...


  If (is_method("INVITE"))


Re: [SR-Users] FW: Kamailio as sipRedirect

2012-09-05 Thread Fatima Chahrour~Vanrise Support
Hi Daniel,

 

The call is not redirected to 1st kamailio, below is the call trace where 2nd  
kamailio(192.168.111.139) send request to 192.168.111.15 which is the gateway 
in the lcr rule instead of sending this invite to 192.168.111.138.

 

U 192.168.111.139:5060 - 192.168.111.15:5060 (shouldn’t this be 
192.168.111.138:5060 instead??)

INVITE sip:22#96135050@192.168.111.15 SIP/2.0.

Record-Route: sip:192.168.111.139;lr=on.

Record-Route: sip:192.168.111.138;lr=on.

Via: SIP/2.0/UDP 192.168.111.139;branch=z9hG4bK5757.5b3b1975.0.

Via: SIP/2.0/UDP 192.168.111.138;branch=z9hG4bK5757.50ff9264.0.

Via: SIP/2.0/UDP 
192.168.52.139:12650;received=192.168.111.11;branch=z9hG4bK-d8754z-85008205ba3ea607-1---d8754z-;rport=12650.

Max-Forwards: 68.

Contact: sip:106@192.168.111.11:12650.

To: 96135050sip:96135050@192.168.111.138.

From: 106sip:106@192.168.111.138;tag=56645478.

Call-ID: ZjJlYWYzZmJmYmJlMGE0MmYxYWUwYjYwZmY5MmJkMjg..

CSeq: 1 INVITE.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO.

Content-Type: application/sdp.

User-Agent: X-Lite release 1100l stamp 47546.

Content-Length: 477.

 

This is my Kamailio routing logic configured on the 1st Kamailio to forward any 
call from 1st kamialio to 2nd kamailio:

 

if (is_method(INVITE))

{

Sethostport(“192.168.111.139:5060”);

Append_branch();

}

 

My problem is hereà This is my Kamailio routing configured on 2nd kamailio 
which I want from it to send back the call, with lcr_gateway already defined, 
to 1st Kamailio:

 

if (is_method(INVITE))

{

  if (!load_gws(1)) {

  sl_send_reply(503, Unable to load gateways);

  exit;

   }

  if(!next_gw()){

  sl_send_reply(503, Unable to find a gateway);

  exit;}



  route(1);

 

  $ru=sip:.*@192.168.111.138;

  send_reply(302,rEdIrEcTeD);

   km_append_branch(uri);

}

 

Am looking through many documents but can’t achieve my target, I want the 2nd 
Kamailio, which has LCR configured on it, to send back to 1st Kamailio the 
gateway from lcr_gateways with 302 redirect message.

 

My questions are:

How to achieve this? 

Do you suggest any document that help?

Do I need to load any specific module?

 

Thanks,

F Chahrour

 

From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: Wednesday, September 05, 2012 9:38 AM
To: Fatima Chahrour~Vanrise Support
Cc: 'SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users 
Mailing List'
Subject: Re: [SR-Users] FW: Kamailio as sipRedirect

 

Hello,
You set r-uri ($ru) to an IP address only -- it has to be a full SIP URI.

Cheers,
Daniel

On 9/4/12 5:34 PM, Fatima Chahrour~Vanrise Support wrote:

Hello,

 

Thanks for your reply.. am able to make the call reach from 3CX to Kamailio 
using the src_ip, thank you, but still not able to redirect the call invite 
from Kamailio to 3CX and send the 302 message.

 

Kamailio instead of 3CX

192.168.111.138

 








Kamailio

192.168.111.139

 


 

Phone A  (192.168.111.11)

 

302

Phone B (192.168.111.10)

 

Herby what am putting in my routing:

 

If (is_method(INVITE))

 

{ if(!load_gateway(1)) {

sl_send_reply(503, unable to load gateways);

Exit;  }

 

{ if(! next_gateway()) {

sl_send_reply(503, unable to find gateways);

Exit;  }

Route(1);

 

$ru = 192.168.111.138;
send_reply(302, Redirected;

Km_append_branch(“uri”);

Exit;




What am I doing is wrong in the above script? And causing “call failed”! 
attached ‘test.txt’ the ngrep capture if needed.

 

Your help is highly appreciated.

 

Kind Regards,

F Chahrour

From: sr-users-boun...@lists.sip-router.org 
[mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of Daniel-Constantin 
Mierla
Sent: Thursday, August 30, 2012 10:56 AM
To: Fatima Chahrour
Cc: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users 
Mailing List
Subject: Re: [SR-Users] FW: Kamailio as sipRedirect

 

Hello,

if you know the IP address of 3CX, then you can skip authentication for that, 
like:

if(src_ip==__3cx_ip__) {
  # don't do authentication for the traffic coming here

}

You can use permission module to store the a list of ip addresses and then use 
functions from that module to match against source ip of requests, as 
alternative to above, providing more flexibility when dealing with lot of 
trusted ip addresses.

Cheers,
Daniel

On 8/29/12 9:15 PM, Fatima Chahrour wrote:

Hello Danial,

 

Hereby details:

My current working 1st scenario is a call generated from A-party x-lite 
registered on kamalio, this call is routed based on kamailio lcr routing module 
which add prefix and send prefix to 3CX then 3CX forward the call to B-party 
x-lite, registered on 3CX, successfully.

 

In kamailio.cfg routing logic I only used :

 

...

If (is_method

Re: [SR-Users] FW: Kamailio as sipRedirect

2012-09-04 Thread Fatima Chahrour~Vanrise Support
Hello,

 

Thanks for your reply.. am able to make the call reach from 3CX to Kamailio 
using the src_ip, thank you, but still not able to redirect the call invite 
from Kamailio to 3CX and send the 302 message.

 






Kamailio 

192.168.111.139

 

 

 


Phone A  (192.168.111.11)

 




302

 
Phone B (192.168.111.10)

 

Herby what am putting in my routing:

 

If (is_method(INVITE))

 

{ if(!load_gateway(1)) {

sl_send_reply(503, unable to load gateways);

Exit;  }

 

{ if(! next_gateway()) {

sl_send_reply(503, unable to find gateways);

Exit;  }

Route(1);

 

$ru = 192.168.111.138;
send_reply(302, Redirected;

Km_append_branch(“uri”);

Exit;



What am I doing is wrong in the above script? And causing “call failed”! 
attached ‘test.txt’ the ngrep capture if needed.

 

Your help is highly appreciated.

 

Kind Regards,

F Chahrour

From: sr-users-boun...@lists.sip-router.org 
[mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of Daniel-Constantin 
Mierla
Sent: Thursday, August 30, 2012 10:56 AM
To: Fatima Chahrour
Cc: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users 
Mailing List
Subject: Re: [SR-Users] FW: Kamailio as sipRedirect

 

Hello,

if you know the IP address of 3CX, then you can skip authentication for that, 
like:

if(src_ip==__3cx_ip__) {
  # don't do authentication for the traffic coming here

}

You can use permission module to store the a list of ip addresses and then use 
functions from that module to match against source ip of requests, as 
alternative to above, providing more flexibility when dealing with lot of 
trusted ip addresses.

Cheers,
Daniel

On 8/29/12 9:15 PM, Fatima Chahrour wrote:

Hello Danial,

 

Hereby details:

My current working 1st scenario is a call generated from A-party x-lite 
registered on kamalio, this call is routed based on kamailio lcr routing module 
which add prefix and send prefix to 3CX then 3CX forward the call to B-party 
x-lite, registered on 3CX, successfully.

 

In kamailio.cfg routing logic I only used :

 

...

If (is_method(INVITE))

{ if(!load_gateway(1)) {

sl_send_reply(503, unable to load gateways);

Exit;  }

 

{ if(! next_gateway()) {

sl_send_reply(503, unable to find gateways);

Exit;  }

 Route(1);



 

Now, my target is to register also the A-party x-lite to 3CX where I added a 
rule in 3CX to forward the call comming to kamailio to take the route desicion 
and act.

 

So, here I need to know how can I tell kamailio to accept the call from 3CX? 
this is what I meant by configuring 3CX on kamailio.

 

I have weakness in the routing logic configuration, could you please help in 
this too! What is the required replacement on the above to be done?

 

Moreover, I appreciate if you provide with docs or tutorials that can help me 
understand more kamailio's routing logic functions!

 

Much appreciated.

 

Thanks in advance.

 

F Chahrour

 

Sent from iPhone


On Aug 29, 2012, at 9:21 PM, Daniel-Constantin Mierla mico...@gmail.com wrote:

Hello,

On 8/29/12 3:31 PM, Fatima Chahrour~Vanrise Support wrote:

Dears,

 

I have an installed 3CX where I want to generate a call from it to the Kamailo 
to get a list of suppliers to terminate the call to.

Thus, the Kamailio should act as a sip redirect to the 3CX (for routing 
decision).

 

Have you tried such configuration before? And how do I configure the 3CX on the 
Kamailio?

 

I don't understand what you expect from 'configure the 3CX on the Kamailio', 
can you add more details ?

For sending a redirect, practically you have to update request uri and then 
send the 3xx reply, like:

$ru =  sip:newnum...@newdomain.com sip:newnum...@newdomain.com;
send_reply(302, Redirected;

If you need to put more contacts in the redirect reply, then add:

km_append_branch(uri);

uri parameter can contain variables.

Cheers,
Daniel







-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda http://twitter.com/#%21/miconda  - 
http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - http://asipto.com/u/kat





-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - http://asipto.com/u/kat
image001.pngimage005.pngimage006.pnginterface: eth0 (192.168.111.0/255.255.255.0)
filter: (ip or ip6) and ( port 5060 )

U 192.168.111.138:5060 - 192.168.111.139:5060
INVITE sip:961325252525@192.168.111.139:5060 SIP/2.0.
Record-Route: sip:192.168.111.138;lr=on.
Via: SIP/2.0/UDP 192.168.111.138;branch=z9hG4bK9c47.a9dbeca3.0.
Via: SIP/2.0/UDP 
192.168.52.139:12382;received=192.168.111.11;branch=z9hG4bK-d8754z-6b29401c46626f6f-1---d8754z-;rport=12382.
Max-Forwards: 69.
Contact: sip:106@192.168.111.11:12382.
To: 961325252525sip:961325252525@192.168.111.138.
From: 106sip:106@192.168.111.138;tag=ac5dc85f.
Call-ID

Re: [SR-Users] FW: Kamailio as sipRedirect

2012-08-30 Thread Daniel-Constantin Mierla

Hello,

if you know the IP address of 3CX, then you can skip authentication for 
that, like:


if(src_ip==__3cx_ip__) {
  # don't do authentication for the traffic coming here

}

You can use permission module to store the a list of ip addresses and 
then use functions from that module to match against source ip of 
requests, as alternative to above, providing more flexibility when 
dealing with lot of trusted ip addresses.


Cheers,
Daniel

On 8/29/12 9:15 PM, Fatima Chahrour wrote:

Hello Danial,

Hereby details:
My current working 1st scenario is a call generated from A-party 
x-lite registered on kamalio, this call is routed based on kamailio 
lcr routing module which add prefix and send prefix to 3CX then 3CX 
forward the call to B-party x-lite, registered on 3CX, successfully.


In kamailio.cfg routing logic I only used :

...
If (is_method(INVITE))
{ if(!load_gateway(1)) {
sl_send_reply(503, unable to load gateways);
Exit;  }

{ if(! next_gateway()) {
sl_send_reply(503, unable to find gateways);
Exit;  }
 Route(1);


Now, my target is to register also the A-party x-lite to 3CX where I 
added a rule in 3CX to forward the call comming to kamailio to take 
the route desicion and act.


So, here I need to know how can I tell kamailio to accept the call 
from 3CX? this is what I meant by configuring 3CX on kamailio.


I have weakness in the routing logic configuration, could you please 
help in this too! What is the required replacement on the above to be 
done?


Moreover, I appreciate if you provide with docs or tutorials that can 
help me understand more kamailio's routing logic functions!


Much appreciated.

Thanks in advance.

F Chahrour

Sent from iPhone

On Aug 29, 2012, at 9:21 PM, Daniel-Constantin Mierla 
mico...@gmail.com mailto:mico...@gmail.com wrote:



Hello,

On 8/29/12 3:31 PM, Fatima Chahrour~Vanrise Support wrote:


Dears,

I have an installed 3CX where I want to generate a call from it to 
the Kamailo to get a list of suppliers to terminate the call to.


Thus, the Kamailio should act as a sip redirect to the 3CX (for 
routing decision).


Have you tried such configuration before? And how do I configure the 
3CX on the Kamailio?


I don't understand what you expect from 'configure the 3CX on the 
Kamailio', can you add more details ?


For sending a redirect, practically you have to update request uri 
and then send the 3xx reply, like:


$ru = sip:newnum...@newdomain.com;
send_reply(302, Redirected;

If you need to put more contacts in the redirect reply, then add:

km_append_branch(uri);

uri parameter can contain variables.

Cheers,
Daniel

--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda  http://twitter.com/#%21/miconda  
-http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 -http://asipto.com/u/kat


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - http://asipto.com/u/kat

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] FW: Kamailio as sipRedirect

2012-08-29 Thread Daniel-Constantin Mierla

Hello,

On 8/29/12 3:31 PM, Fatima Chahrour~Vanrise Support wrote:


Dears,

I have an installed 3CX where I want to generate a call from it to the 
Kamailo to get a list of suppliers to terminate the call to.


Thus, the Kamailio should act as a sip redirect to the 3CX (for 
routing decision).


Have you tried such configuration before? And how do I configure the 
3CX on the Kamailio?


I don't understand what you expect from 'configure the 3CX on the 
Kamailio', can you add more details ?


For sending a redirect, practically you have to update request uri and 
then send the 3xx reply, like:


$ru = sip:newnum...@newdomain.com;
send_reply(302, Redirected;

If you need to put more contacts in the redirect reply, then add:

km_append_branch(uri);

uri parameter can contain variables.

Cheers,
Daniel

--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - http://asipto.com/u/kat

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] FW: Kamailio as sipRedirect

2012-08-29 Thread Fatima Chahrour
Hello Danial,

Hereby details:
My current working 1st scenario is a call generated from A-party x-lite 
registered on kamalio, this call is routed based on kamailio lcr routing module 
which add prefix and send prefix to 3CX then 3CX forward the call to B-party 
x-lite, registered on 3CX, successfully.

In kamailio.cfg routing logic I only used :

...
If (is_method(INVITE))
{ if(!load_gateway(1)) {
sl_send_reply(503, unable to load gateways);
Exit;  }

{ if(! next_gateway()) {
sl_send_reply(503, unable to find gateways);
Exit;  }
 Route(1);


Now, my target is to register also the A-party x-lite to 3CX where I added a 
rule in 3CX to forward the call comming to kamailio to take the route desicion 
and act.

So, here I need to know how can I tell kamailio to accept the call from 3CX? 
this is what I meant by configuring 3CX on kamailio.

I have weakness in the routing logic configuration, could you please help in 
this too! What is the required replacement on the above to be done?

Moreover, I appreciate if you provide with docs or tutorials that can help me 
understand more kamailio's routing logic functions!

Much appreciated.

Thanks in advance.

F Chahrour

Sent from iPhone

On Aug 29, 2012, at 9:21 PM, Daniel-Constantin Mierla mico...@gmail.com wrote:

 Hello,
 
 On 8/29/12 3:31 PM, Fatima Chahrour~Vanrise Support wrote:
 Dears,
  
 I have an installed 3CX where I want to generate a call from it to the 
 Kamailo to get a list of suppliers to terminate the call to.
 Thus, the Kamailio should act as a sip redirect to the 3CX (for routing 
 decision).
  
 Have you tried such configuration before? And how do I configure the 3CX on 
 the Kamailio?
  
 I don't understand what you expect from 'configure the 3CX on the Kamailio', 
 can you add more details ?
 
 For sending a redirect, practically you have to update request uri and then 
 send the 3xx reply, like:
 
 $ru = sip:newnum...@newdomain.com;
 send_reply(302, Redirected;
 
 If you need to put more contacts in the redirect reply, then add:
 
 km_append_branch(uri);
 
 uri parameter can contain variables.
 
 Cheers,
 Daniel
 
 
 -- 
 Daniel-Constantin Mierla - http://www.asipto.com
 http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
 Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - http://asipto.com/u/kat

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users