[SR-Users] FW: Kamailio as sipRedirect

Fatima Chahrour~Vanrise Support fchahrour at vanrise.com
Tue Sep 4 17:34:15 CEST 2012


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-bounces at lists.sip-router.org [mailto:sr-users-bounces at 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 <miconda at 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:newnumber at newdomain.com> "sip:newnumber at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120904/da38b879/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 1551 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120904/da38b879/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 219 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120904/da38b879/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 238 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120904/da38b879/attachment-0005.png>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.txt
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120904/da38b879/attachment-0001.txt>


More information about the sr-users mailing list