Re: [SR-Users] Help with sip balancer

2015-08-11 Thread Alexandru Covalschi
First of all I'd suggest to use
http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb
guide in combination with
http://saevolgo.blogspot.com/2011/11/how-to-increasing-voip-services.html
But, assuming your platform is behind NAT, you need:
1st. Use rtpengine instead of rtpproxy. You can read about how to advertise
your external public adress on rtpengine git page.
2nd. In Kamailio configuration when you define listen, you should use
listen - advertise construction (
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen).
3d. Be sure to leave secret column empty on asterisk database, otherwise
all users registered on asterisks won't have OK status, what can cause
problems with queues etc.

2015-08-12 0:19 GMT+03:00 Bruno d4rks...@gmail.com:


 Hello,
 i'm on my first try with kamailio. I need to build a SIP balancer that
 should keep SIP
 registration from VoIP provider and route the calls to the asterisk boxes
 where an IVR
 will take care to answer.

 Here's my network topology:

   +--- [asterisk1]
 [public_ip]   |10.50.10.131
  [router]  ---NAT--- [kamailio] ---+
 10.50.10.110.50.10.120|
   +--- [asterisk2]
10.50.10.132

 In my setup i planned to use UAC and DISPATCHER modules. I started from
 the
 kamailio-basic.cfg and added some extra lines to handle UAC and
 DISPATCHER.

 All is working fine when i do a test call from a softphone inside network
 10.50.10.0/24.

 When a call is coming from the sip carrier, troubles occurs because
 asterisk boxes
 are sending their internal ip in SDP.

 I understand that i need to rewrite SDP in that case, but i actually don't
 know how/where.

 I've attached kamailio configuration and a sip trace taken with sngrep
 where the problem
 is visible.

 For security reasons, i would like to force the RTP through RTPProxy.

 I'm missing something, and need your help me to understand my errors.

 Best Regards,
 Bruno



 ___
 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




-- 
Alexandru Covalschi
ABRISS-Solutions
VoIP engineer and system administrator
phone: +37367398493
web: http://abs-telecom.com/
___
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


[SR-Users] Help with sip balancer

2015-08-11 Thread Bruno
Hello,
i'm on my first try with kamailio. I need to build a SIP balancer that
should keep SIP
registration from VoIP provider and route the calls to the asterisk boxes
where an IVR
will take care to answer.

Here's my network topology:

  +--- [asterisk1]
[public_ip]   |10.50.10.131
 [router]  ---NAT--- [kamailio] ---+
10.50.10.110.50.10.120|
  +--- [asterisk2]
   10.50.10.132

In my setup i planned to use UAC and DISPATCHER modules. I started from the
kamailio-basic.cfg and added some extra lines to handle UAC and
DISPATCHER.

All is working fine when i do a test call from a softphone inside network
10.50.10.0/24.

When a call is coming from the sip carrier, troubles occurs because
asterisk boxes
are sending their internal ip in SDP.

I understand that i need to rewrite SDP in that case, but i actually don't
know how/where.

I've attached kamailio configuration and a sip trace taken with sngrep
where the problem
is visible.

For security reasons, i would like to force the RTP through RTPProxy.

I'm missing something, and need your help me to understand my errors.

Best Regards,
Bruno
 Call flow for 
929B936-3FE5-9C28C7E1-A16E3F0E (Color by Request/Response)

   │SIP/2.0 200 OK
80.110.120.10:506010.50.10.120:5060 
10.50.10.132:5060  │Via: SIP/2.0/UDP 
10.50.10.120;branch=z9hG4bKe82d.a3414799f56e1046d9fede67b168a2ae.0;recei
  ──┬─  ──┬─  
──┬─ │d=10.50.10.120;rport=5060
  05:37:29.196212   │  INV (80.110.120.12:57662)  │ 
│  │Via: SIP/2.0/UDP 
80.110.120.10:5060;rport=5060;branch=z9hG4bKe82d.0079d4c5.0
│ ── │ 
│  │Via: SIP/2.0/UDP 
80.110.16.2:5060;rport=61413;received=80.110.16.2;x-route-tag=tgrp:Slot
  05:37:29.204187   │  100 trying -- your call is │ 
│  │;branch=z9hG4bKA4079B1AD1
│ ── │ 
│  │Record-Route: sip:10.50.10.120;lr=on;ftag=32CDDD90-24CE
  05:37:29.205294   │ │  INV (80.110.120.12:57662)  
│  │Record-Route: 
sip:80.110.120.10;lr;ftag=32CDDD90-24CE;did=bb31.a983e793
│ │ ── 
│  │From: sip:8231288481@80.110.16.2;tag=32CDDD90-24CE
  05:37:29.229975   │ │ 100 Trying  
│  │To: sip:9822147...@voip.carrier.me;tag=as355bc928
│ │ ── 
│  │Call-ID: 929B936-3FE5-9C28C7E1-A16E3F0E@80.110.16.2
  05:37:29.233990   │ │  200 (10.50.10.132:10832)   
│  │CSeq: 101 INVITE
│ │ ── 
│  │Server: Asterisk PBX 13.1-cert2
  05:37:29.235113   │  200 (10.50.10.132:10832)   │ 
│  │Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, 
INFO, PUBLISH, MESSAG
│ ── │ 
│  │Supported: replaces, timer
  05:37:29.333226   │ │  200 (10.50.10.132:10832)   
│  │Contact: sip:9822147941@10.50.10.132:5060
│ │  
│  │Content-Type: application/sdp
  05:37:29.335947   │  200 (10.50.10.132:10832)   │ 
│  │Content-Length: 347
│  │ 
│  │
  05:37:29.533537   │ │  200 (10.50.10.132:10832)   
│  │v=0
│ │  
│  │o=root 397373482 397373482 IN IP4 10.50.10.132
  05:37:29.535938   │  200 (10.50.10.132:10832)   │ 
│  │s=Asterisk PBX 13.1-cert2
│  │ 
│  │c=IN IP4 10.50.10.132
  05:37:29.934272   │ │  200 (10.50.10.132:10832)   
│  │t=0 0
│ │  
│  │m=audio 10832 RTP/AVP 3 18 8 0 101
  05:37:29.935421   │  200 (10.50.10.132:10832)   │ 
│  │a=rtpmap:3 GSM/8000
│  │ 
│  │a=rtpmap:18 G729/8000
  05:37:30.734051   │ │  200 

Re: [SR-Users] Help with sip balancer

2015-08-11 Thread Alexandru Covalschi
Also, take a look at kamailio-advanced.cfg, there is PSTN GW route already
included. Also you can use LCR for routing calls to different providers, a
simple guide can be found here
http://dopensource.com/least-cost-routing-with-kamailio-v4-1/

2015-08-12 0:41 GMT+03:00 Alexandru Covalschi 568...@gmail.com:

 First of all I'd suggest to use
 http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb
 guide in combination with
 http://saevolgo.blogspot.com/2011/11/how-to-increasing-voip-services.html
 But, assuming your platform is behind NAT, you need:
 1st. Use rtpengine instead of rtpproxy. You can read about how to
 advertise your external public adress on rtpengine git page.
 2nd. In Kamailio configuration when you define listen, you should use
 listen - advertise construction (
 http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen).
 3d. Be sure to leave secret column empty on asterisk database, otherwise
 all users registered on asterisks won't have OK status, what can cause
 problems with queues etc.

 2015-08-12 0:19 GMT+03:00 Bruno d4rks...@gmail.com:


 Hello,
 i'm on my first try with kamailio. I need to build a SIP balancer that
 should keep SIP
 registration from VoIP provider and route the calls to the asterisk boxes
 where an IVR
 will take care to answer.

 Here's my network topology:

   +--- [asterisk1]
 [public_ip]   |10.50.10.131
  [router]  ---NAT--- [kamailio] ---+
 10.50.10.110.50.10.120|
   +--- [asterisk2]
10.50.10.132

 In my setup i planned to use UAC and DISPATCHER modules. I started from
 the
 kamailio-basic.cfg and added some extra lines to handle UAC and
 DISPATCHER.

 All is working fine when i do a test call from a softphone inside network
 10.50.10.0/24.

 When a call is coming from the sip carrier, troubles occurs because
 asterisk boxes
 are sending their internal ip in SDP.

 I understand that i need to rewrite SDP in that case, but i actually
 don't know how/where.

 I've attached kamailio configuration and a sip trace taken with sngrep
 where the problem
 is visible.

 For security reasons, i would like to force the RTP through RTPProxy.

 I'm missing something, and need your help me to understand my errors.

 Best Regards,
 Bruno



 ___
 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




 --
 Alexandru Covalschi
 ABRISS-Solutions
 VoIP engineer and system administrator
 phone: +37367398493
 web: http://abs-telecom.com/




-- 
Alexandru Covalschi
ABRISS-Solutions
VoIP engineer and system administrator
phone: +37367398493
web: http://abs-telecom.com/
___
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] force_send_socket/$fs behaviour when binding to INADDR_ANY

2015-08-11 Thread Daniel-Constantin Mierla
Hello,

inaddr any is special as a single socket receiving all traffic, but then
it has its own limitations when attempting to send.

Kamailio is building the list of sockets at startup and use that at
runtime, so it is not possible to have a new socket added at runtime.

However, depending on what exactly you do, there can be variants at
ip/network layer. Keep adding new sockets to an application can become
inefficient, not matter how it is done.

So, as alternative, for example in the case of clients connecting via
vpn tunnels, the best solution is to have kamailio listening on a single
IP, then have masquerading of the tunnels to this ip. In other words,
the clients will look at being behind nat from sip server point of view.
The route to the IP of the sip server is pushed by th vpn client when
connecting. The overall system has really low overhead, given that is
practically ip forwarding.

That was the example with vpn, if you have other scenario, maybe you can
give more details in order to see if there are other solutions.

Cheers,
Daniel

On 10/08/15 23:34, Alex Balashov wrote:
 Hello,

 When binding Kamailio to 0.0.0.0, Kamailio no longer recognises any
 specific IP address homed on the system as being a socket for
 purposes of forcing traffic out of any specific interface (i.e.
 setting $fs), or any other purpose for which ingress and egress
 sockets are tracked (e.g. double RR).

 As I understand it, this is because Kamailio considers only addresses
 explicitly specified via the 'listen' core config directive to be
 valid send socket arguments. Kamailio _will_ accept addresses
 already attached to the interface if it is bound interface-wise, e.g.

listen=eth1:5060

 but not when addresses are added to the interface without restarting
 the proxy:

 # ip addr add dev eth1 172.30.110.10/24

 Aug 10 17:31:35 centosity6 /usr/local/sbin/kamailio[28627]: WARNING:
 pv [pv_core.c:2285]: pv_set_force_sock(): no socket found to match
 [udp:172.30.110.10:5060]

 Is there any straightforward way to modify this behaviour, so that it
 would be possible to dynamically add addresses to existing physical
 interfaces and get Kamailio to utilise them as if they were bound at
 boot time?

 Thanks,

 -- Alex


-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com


___
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


[SR-Users] Trailing newline with {re.subst,expression}

2015-08-11 Thread Daniel Tryba
I'm unable to get rid of the \n in multiline content of a var.

xlog(var: $var(sdp));
$var(sdp)=$(var(sdp){re.subst,/^a=rtcp:.*//});
xlog(var: $var(sdp));

a=sendrecv#015#012a=rtcp:31543#015#012a=X-foo:bar
becomes:
a=sendrecv#015#012#012a=X-foo:bar

Using the s flag results in no substitution at all, /^a=rtcp:.*//s should 
result in
a=sendrecv#015#012
according to
http://www.kamailio.org/wiki/cookbooks/4.3.x/transformations#resubst_expression

Is this a bug or a feature? If it is a feature, how to get rid of the newline 
(without additional regexps substitutions).

___
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] sdp manipulation in connection with rtpengine_offer/answer calls

2015-08-11 Thread Camille Oudot
Le Mon, 10 Aug 2015 18:33:47 +0200,
Daniel Tryba d.tr...@pocos.nl a écrit :

 Only strange thing is that $var(sdp) is set to 0 on on the second
 passing of below during branch routing after handling a 302 redirect

I don't know the full context here, but since $var()s are
process-local, is the process reading the 0 value the same one that
has set it?

-- 
Camille

___
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] LCR Routing - Cost based routing

2015-08-11 Thread DanB

Hi Alexandru,

Well the concept is simple: on INVITE, you will issue a special format 
evapi request. You will receive the list of suppliers in the reply 
(which is received in a separate route) and you continue processing from 
there. These suppliers are simple tags so your creativity will be the 
limit of what you can do with them - eg: direct ip addresses received or 
tags of suppliers which you can further translate with drouting module 
or any alias related one.


For more information on LCR please find this year's presentation on 
Kamailio World (which I strongly recommend to be attended):


https://www.youtube.com/watch?v=Hsvcwleb-fY

You can also find the kamailio configuration which I have used in the 
worshop here:


https://github.com/cgrates/cgrates/tree/master/data/tutorials/kamevapi/kamailio/etc/kamailio

Let me know if further questions (or join our irc or mailing list so we 
do not create too much noise here).


DanB

___
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] kamailio as SIP Agent

2015-08-11 Thread SamyGo
Hi Sandeep,
what is the problem here ? Kamailio just sends a 404 on its own or is
really sending calls to MSC and MSC is replying with 404 ?


On Mon, Aug 10, 2015 at 12:33 PM, Sandeep Chakravarthi 
ivschakravar...@gmail.com wrote:

 Hi ,
 Sorry for the delayed reply.
 I have configured my Asterisk and kamailio server, but when i initiate one
 outbound call from my asterisk server to kamailio server, kamailio server
 is initiating the call to MSC.
 Please find the attached pcap details for your reference.
 Below is my kamailio debug log and kamailio.cfg file.
 Please check the pcap and below cfg file and log file and let me know
 whether to change anything in cfg file or not.

 


 request_route {

 # per request initial checks
 route(REQINIT);

 # NAT detection
 route(NATDETECT);

 # CANCEL processing
 if (is_method(CANCEL))
 {
 if (t_check_trans()) {
 route(RELAY);
 }
 exit;
 }

 # handle requests within SIP dialogs
 route(WITHINDLG);

 ### only initial requests (no To tag)

 t_check_trans();

 # authentication
 route(AUTH);


 # record routing for dialog forming requests (in case they are
 routed)
 # - remove preloaded route headers
 remove_hf(Route);
 if (is_method(INVITE|SUBSCRIBE))
 record_route();

 # account only INVITEs
 if (is_method(INVITE))
 {
 setflag(FLT_ACC); # do accounting
 }
 route(TOASTERISK);

 # dispatch requests to foreign domains
 route(SIPOUT);

 ### requests for my local domains

 # handle presence related requests
 route(PRESENCE);

 # handle registrations
 route(REGISTRAR);

 if ($rU==$null)
 {
 # request with no Username in RURI
 sl_send_reply(484,Address Incomplete);
 exit;
 }

 # dispatch destinations to PSTN
 route(PSTN);
 # user location service
 route(LOCATION);
 }

 route[TOASTERISK] {
 if(ds_is_from_list(2)) {
 #Call from Telco Should goto Asterisk pool in Loadbalanced mode
  if(!ds_select_dst(1, 4)) {
 sl_send_reply(500, Service Unavailable);
 xlog(L_INFO,[$fU@$si:$sp]{$rm} No destinations
 available for $rd \n);
 exit;
 }
 }if(ds_is_from_list(1)) {
 #Call from Asterisk servers pool, send it to telco using LoadBalancer
 if(!ds_select_dst(2, 4)) {
 sl_send_reply(500, Service Unavailable);
 xlog(L_INFO,[$fU@$si:$sp]{$rm} No destinations
 available for $rd \n);
 exit;
 }
  }

 }
 +

 Debug log

  8(1186) DEBUG: core [parser/msg_parser.c:623]: parse_msg(): SIP Request:
  8(1186) DEBUG: core [parser/msg_parser.c:625]: parse_msg():  method:
  INVITE
  8(1186) DEBUG: core [parser/msg_parser.c:627]: parse_msg():  uri: 
 sip:0730092190@172.22.14.12
  8(1186) DEBUG: core [parser/msg_parser.c:629]: parse_msg():  version:
 SIP/2.0
  8(1186) DEBUG: core [parser/parse_via.c:1284]: parse_via_param(): Found
 param type 232, branch = z9hG4bK3c5fb091; state=16
  8(1186) DEBUG: core [parser/parse_via.c:2672]: parse_via(): end of
 header reached, state=5
  8(1186) DEBUG: core [parser/msg_parser.c:513]: parse_headers():
 parse_headers: Via found, flags=2
  8(1186) DEBUG: core [parser/msg_parser.c:515]: parse_headers():
 parse_headers: this is the first via
  8(1186) DEBUG: core [receive.c:152]: receive_msg(): After parse_msg...
  8(1186) DEBUG: core [receive.c:193]: receive_msg(): preparing to run
 routing scripts...
  8(1186) DEBUG: maxfwd [mf_funcs.c:85]: is_maxfwd_present(): value = 70
  8(1186) DEBUG: core [parser/parse_addr_spec.c:898]: parse_addr_spec():
 end of header reached, state=10
  8(1186) DEBUG: core [parser/msg_parser.c:190]: get_hdr_field(): DEBUG:
 get_hdr_field: To [31]; uri=[sip:0730092190@172.22.14.12]
  8(1186) DEBUG: core [parser/msg_parser.c:192]: get_hdr_field(): DEBUG:
 to body [sip:0730092190@172.22.14.12
 ]
  8(1186) DEBUG: core [parser/msg_parser.c:170]: get_hdr_field():
 get_hdr_field: cseq CSeq: 102 INVITE
  8(1186) DEBUG: core [parser/msg_parser.c:204]: get_hdr_field(): DEBUG:
 get_hdr_body : content_length=327
  8(1186) DEBUG: core [parser/msg_parser.c:106]: get_hdr_field(): found
 end of header
  8(1186) DEBUG: core [parser/parse_addr_spec.c:176]: parse_to_param():
 DEBUG: add_param: tag=as4decf975
  8(1186) DEBUG: core [parser/parse_addr_spec.c:898]: parse_addr_spec():
 end of header reached, state=29
  8(1186) DEBUG: sanity [mod_sanity.c:255]: w_sanity_check(): sanity checks
 result: 1
  8(1186) DEBUG: 

Re: [SR-Users] kamailio as SIP Agent

2015-08-11 Thread Sandeep Chakravarthi
Hi,
Kamailio  is sending 404 Response and its not MSC.
If you see the pcap file , Kamailio has to forward the SIP invite packet to
MSC which it got from Asterisk server. But it is not happening.
I am attaching the pcap one more time for your reference.

In my pcap, below are the server details

172.22.14.12 - Kamailio server
172.22.14.17 - Asterisk server
172.22.0.68 - MSC


Regards,
Sandeep

Warm Regards,
Sandeep Chakravarthi.

On Tue, Aug 11, 2015 at 7:10 PM, SamyGo govoi...@gmail.com wrote:

 Hi Sandeep,
 what is the problem here ? Kamailio just sends a 404 on its own or is
 really sending calls to MSC and MSC is replying with 404 ?


 On Mon, Aug 10, 2015 at 12:33 PM, Sandeep Chakravarthi 
 ivschakravar...@gmail.com wrote:

 Hi ,
 Sorry for the delayed reply.
 I have configured my Asterisk and kamailio server, but when i initiate
 one outbound call from my asterisk server to kamailio server, kamailio
 server is initiating the call to MSC.
 Please find the attached pcap details for your reference.
 Below is my kamailio debug log and kamailio.cfg file.
 Please check the pcap and below cfg file and log file and let me know
 whether to change anything in cfg file or not.

 


 request_route {

 # per request initial checks
 route(REQINIT);

 # NAT detection
 route(NATDETECT);

 # CANCEL processing
 if (is_method(CANCEL))
 {
 if (t_check_trans()) {
 route(RELAY);
 }
 exit;
 }

 # handle requests within SIP dialogs
 route(WITHINDLG);

 ### only initial requests (no To tag)

 t_check_trans();

 # authentication
 route(AUTH);


 # record routing for dialog forming requests (in case they are
 routed)
 # - remove preloaded route headers
 remove_hf(Route);
 if (is_method(INVITE|SUBSCRIBE))
 record_route();

 # account only INVITEs
 if (is_method(INVITE))
 {
 setflag(FLT_ACC); # do accounting
 }
 route(TOASTERISK);

 # dispatch requests to foreign domains
 route(SIPOUT);

 ### requests for my local domains

 # handle presence related requests
 route(PRESENCE);

 # handle registrations
 route(REGISTRAR);

 if ($rU==$null)
 {
 # request with no Username in RURI
 sl_send_reply(484,Address Incomplete);
 exit;
 }

 # dispatch destinations to PSTN
 route(PSTN);
 # user location service
 route(LOCATION);
 }

 route[TOASTERISK] {
 if(ds_is_from_list(2)) {
 #Call from Telco Should goto Asterisk pool in Loadbalanced mode
  if(!ds_select_dst(1, 4)) {
 sl_send_reply(500, Service Unavailable);
 xlog(L_INFO,[$fU@$si:$sp]{$rm} No
 destinations available for $rd \n);
 exit;
 }
 }if(ds_is_from_list(1)) {
 #Call from Asterisk servers pool, send it to telco using LoadBalancer
 if(!ds_select_dst(2, 4)) {
 sl_send_reply(500, Service Unavailable);
 xlog(L_INFO,[$fU@$si:$sp]{$rm} No
 destinations available for $rd \n);
 exit;
 }
  }

 }
 +

 Debug log

  8(1186) DEBUG: core [parser/msg_parser.c:623]: parse_msg(): SIP
 Request:
  8(1186) DEBUG: core [parser/msg_parser.c:625]: parse_msg():  method:
  INVITE
  8(1186) DEBUG: core [parser/msg_parser.c:627]: parse_msg():  uri: 
 sip:0730092190@172.22.14.12
  8(1186) DEBUG: core [parser/msg_parser.c:629]: parse_msg():  version:
 SIP/2.0
  8(1186) DEBUG: core [parser/parse_via.c:1284]: parse_via_param():
 Found param type 232, branch = z9hG4bK3c5fb091; state=16
  8(1186) DEBUG: core [parser/parse_via.c:2672]: parse_via(): end of
 header reached, state=5
  8(1186) DEBUG: core [parser/msg_parser.c:513]: parse_headers():
 parse_headers: Via found, flags=2
  8(1186) DEBUG: core [parser/msg_parser.c:515]: parse_headers():
 parse_headers: this is the first via
  8(1186) DEBUG: core [receive.c:152]: receive_msg(): After parse_msg...
  8(1186) DEBUG: core [receive.c:193]: receive_msg(): preparing to run
 routing scripts...
  8(1186) DEBUG: maxfwd [mf_funcs.c:85]: is_maxfwd_present(): value = 70
  8(1186) DEBUG: core [parser/parse_addr_spec.c:898]: parse_addr_spec():
 end of header reached, state=10
  8(1186) DEBUG: core [parser/msg_parser.c:190]: get_hdr_field(): DEBUG:
 get_hdr_field: To [31]; uri=[sip:0730092190@172.22.14.12]
  8(1186) DEBUG: core [parser/msg_parser.c:192]: get_hdr_field(): DEBUG:
 to body [sip:0730092190@172.22.14.12
 ]
  8(1186) DEBUG: core [parser/msg_parser.c:170]: get_hdr_field():
 get_hdr_field: cseq CSeq: 102 INVITE
  8(1186) 

Re: [SR-Users] kamailio as SIP Agent

2015-08-11 Thread SamyGo
Thats because your configuration file is not sending packet out (RELAY) to
MSC instead it is only doing a Loadbalancer / destination lookup in
TOASTERISK route and comes out of it, processes the following routes in
order
  route(SIPOUT);
  route(PRESENCE);
  route(REGISTRAR);
  route(PSTN);
  route(LOCATION);

Where finally in LOCATION route it tries to find the destination user
0730092190 online locally on Kamailio, which it can't find and says 404 Not
Found.

You should modify your TOASTERISK route as follow:

route[TOASTERISK] {
if(ds_is_from_list(2)) {
#Call from Telco Should goto Asterisk pool in Loadbalanced mode
 if(!ds_select_dst(1, 4)) {
sl_send_reply(500, Service Unavailable);
xlog(L_INFO,[$fU@$si:$sp]{$rm} No destinations
available for $rd \n);
exit;
}
route(RELAY);
}if(ds_is_from_list(1)) {
#Call from Asterisk servers pool, send it to telco using LoadBalancer
if(!ds_select_dst(2, 4)) {
sl_send_reply(500, Service Unavailable);
xlog(L_INFO,[$fU@$si:$sp]{$rm} No destinations
available for $rd \n);
exit;
}
route(RELAY);
 }

}


This will immediately route the packet out towards the new $du after the
loadbalancer function ds_select_dst(...)


On Tue, Aug 11, 2015 at 10:48 AM, Sandeep Chakravarthi 
ivschakravar...@gmail.com wrote:

 Hi,
 Kamailio  is sending 404 Response and its not MSC.
 If you see the pcap file , Kamailio has to forward the SIP invite packet
 to MSC which it got from Asterisk server. But it is not happening.
 I am attaching the pcap one more time for your reference.

 In my pcap, below are the server details

 172.22.14.12 - Kamailio server
 172.22.14.17 - Asterisk server
 172.22.0.68 - MSC


 Regards,
 Sandeep

 Warm Regards,
 Sandeep Chakravarthi.

 On Tue, Aug 11, 2015 at 7:10 PM, SamyGo govoi...@gmail.com wrote:

 Hi Sandeep,
 what is the problem here ? Kamailio just sends a 404 on its own or is
 really sending calls to MSC and MSC is replying with 404 ?


 On Mon, Aug 10, 2015 at 12:33 PM, Sandeep Chakravarthi 
 ivschakravar...@gmail.com wrote:

 Hi ,
 Sorry for the delayed reply.
 I have configured my Asterisk and kamailio server, but when i initiate
 one outbound call from my asterisk server to kamailio server, kamailio
 server is initiating the call to MSC.
 Please find the attached pcap details for your reference.
 Below is my kamailio debug log and kamailio.cfg file.
 Please check the pcap and below cfg file and log file and let me know
 whether to change anything in cfg file or not.

 


 request_route {

 # per request initial checks
 route(REQINIT);

 # NAT detection
 route(NATDETECT);

 # CANCEL processing
 if (is_method(CANCEL))
 {
 if (t_check_trans()) {
 route(RELAY);
 }
 exit;
 }

 # handle requests within SIP dialogs
 route(WITHINDLG);

 ### only initial requests (no To tag)

 t_check_trans();

 # authentication
 route(AUTH);


 # record routing for dialog forming requests (in case they are
 routed)
 # - remove preloaded route headers
 remove_hf(Route);
 if (is_method(INVITE|SUBSCRIBE))
 record_route();

 # account only INVITEs
 if (is_method(INVITE))
 {
 setflag(FLT_ACC); # do accounting
 }
 route(TOASTERISK);

 # dispatch requests to foreign domains
 route(SIPOUT);

 ### requests for my local domains

 # handle presence related requests
 route(PRESENCE);

 # handle registrations
 route(REGISTRAR);

 if ($rU==$null)
 {
 # request with no Username in RURI
 sl_send_reply(484,Address Incomplete);
 exit;
 }

 # dispatch destinations to PSTN
 route(PSTN);
 # user location service
 route(LOCATION);
 }

 route[TOASTERISK] {
 if(ds_is_from_list(2)) {
 #Call from Telco Should goto Asterisk pool in Loadbalanced mode
  if(!ds_select_dst(1, 4)) {
 sl_send_reply(500, Service Unavailable);
 xlog(L_INFO,[$fU@$si:$sp]{$rm} No
 destinations available for $rd \n);
 exit;
 }
 }if(ds_is_from_list(1)) {
 #Call from Asterisk servers pool, send it to telco using LoadBalancer
 if(!ds_select_dst(2, 4)) {
 sl_send_reply(500, Service Unavailable);
 xlog(L_INFO,[$fU@$si:$sp]{$rm} No
 destinations available for $rd \n);
 exit;
 }
  }

 }
 

Re: [SR-Users] sdp manipulation in connection with rtpengine_offer/answer calls

2015-08-11 Thread Camille Oudot
Le Mon, 10 Aug 2015 16:25:36 +0300,
Juha Heinanen j...@tutpro.com a écrit :

 i think it would be useful especially if sdpops functions could also
 be made operate on the pv.  then there would no need to call
 msg_apply_changes().  the pv could be initialized from $rb and when
 all calls that manipulate the body have been made, the pv would be
 assigned to $rb.

Hi,

i've created a merge request on the master branch to add the rtpengine
input SDP pv. I'm not sure if modifying sdpops to work also on
variables would be straightforward, but anyway, most operations can be
done using transformations.

-- 
Camille

___
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] kamailio as SIP Agent

2015-08-11 Thread SamyGo
1 - Take a look at the Kamailio transformations and psuedo-variable page.
 change the $td to the IP of the MSC; modify the $ru as $rU + @
172.22.12.100:5060 where this is IP of MSC side.
2 - Wireshark guys could've said it SIP-3 - point is it doesnt matter at
this point since you know your MSC is replying back and talking to you.



On Tue, Aug 11, 2015 at 1:16 PM, Sandeep Chakravarthi 
ivschakravar...@gmail.com wrote:

 Yes, You are right and done the changes as you suggested.

 Kamailio server is forwarding the call to MSC. But two issues are there.
 1 .In the INVITE packet which is being sent from kamailio server to MSC,
 it is coming Request-Line: INVITE sip:0730092190@*172.22.14.12*
That is my kamailio server IP and it should be MSC IP(172.28.0.68) and
 as of now call is failing as MSC is sending 404 error.
 2. Other issue is , in the pcap file it is coming SIP/SDP as protocol and
 it is not coming SIP-I.

 Please find the latest attached pcap.

 Regards,
 Sandeep


 Warm Regards,
 Sandeep Chakravarthi.

 On Tue, Aug 11, 2015 at 9:47 PM, SamyGo govoi...@gmail.com wrote:

 Thats because your configuration file is not sending packet out (RELAY)
 to MSC instead it is only doing a Loadbalancer / destination lookup in
 TOASTERISK route and comes out of it, processes the following routes in
 order
   route(SIPOUT);
   route(PRESENCE);
   route(REGISTRAR);
   route(PSTN);
   route(LOCATION);

 Where finally in LOCATION route it tries to find the destination user
 0730092190 online locally on Kamailio, which it can't find and says 404 Not
 Found.

 You should modify your TOASTERISK route as follow:

 route[TOASTERISK] {
 if(ds_is_from_list(2)) {
 #Call from Telco Should goto Asterisk pool in Loadbalanced mode
  if(!ds_select_dst(1, 4)) {
 sl_send_reply(500, Service Unavailable);
 xlog(L_INFO,[$fU@$si:$sp]{$rm} No
 destinations available for $rd \n);
 exit;
 }
 route(RELAY);
 }if(ds_is_from_list(1)) {
 #Call from Asterisk servers pool, send it to telco using LoadBalancer
 if(!ds_select_dst(2, 4)) {
 sl_send_reply(500, Service Unavailable);
 xlog(L_INFO,[$fU@$si:$sp]{$rm} No
 destinations available for $rd \n);
 exit;
 }
 route(RELAY);
  }

 }


 This will immediately route the packet out towards the new $du after the
 loadbalancer function ds_select_dst(...)


 On Tue, Aug 11, 2015 at 10:48 AM, Sandeep Chakravarthi 
 ivschakravar...@gmail.com wrote:

 Hi,
 Kamailio  is sending 404 Response and its not MSC.
 If you see the pcap file , Kamailio has to forward the SIP invite packet
 to MSC which it got from Asterisk server. But it is not happening.
 I am attaching the pcap one more time for your reference.

 In my pcap, below are the server details

 172.22.14.12 - Kamailio server
 172.22.14.17 - Asterisk server
 172.22.0.68 - MSC


 Regards,
 Sandeep

 Warm Regards,
 Sandeep Chakravarthi.

 On Tue, Aug 11, 2015 at 7:10 PM, SamyGo govoi...@gmail.com wrote:

 Hi Sandeep,
 what is the problem here ? Kamailio just sends a 404 on its own or is
 really sending calls to MSC and MSC is replying with 404 ?


 On Mon, Aug 10, 2015 at 12:33 PM, Sandeep Chakravarthi 
 ivschakravar...@gmail.com wrote:

 Hi ,
 Sorry for the delayed reply.
 I have configured my Asterisk and kamailio server, but when i initiate
 one outbound call from my asterisk server to kamailio server, kamailio
 server is initiating the call to MSC.
 Please find the attached pcap details for your reference.
 Below is my kamailio debug log and kamailio.cfg file.
 Please check the pcap and below cfg file and log file and let me know
 whether to change anything in cfg file or not.

 


 request_route {

 # per request initial checks
 route(REQINIT);

 # NAT detection
 route(NATDETECT);

 # CANCEL processing
 if (is_method(CANCEL))
 {
 if (t_check_trans()) {
 route(RELAY);
 }
 exit;
 }

 # handle requests within SIP dialogs
 route(WITHINDLG);

 ### only initial requests (no To tag)

 t_check_trans();

 # authentication
 route(AUTH);


 # record routing for dialog forming requests (in case they are
 routed)
 # - remove preloaded route headers
 remove_hf(Route);
 if (is_method(INVITE|SUBSCRIBE))
 record_route();

 # account only INVITEs
 if (is_method(INVITE))
 {
 setflag(FLT_ACC); # do accounting
 }
 route(TOASTERISK);

 # dispatch requests to foreign domains
 route(SIPOUT);

 ### requests for my local domains

 # handle presence related requests
 

Re: [SR-Users] kamailio as SIP Agent

2015-08-11 Thread Sandeep Chakravarthi
Yes, You are right and done the changes as you suggested.

Kamailio server is forwarding the call to MSC. But two issues are there.
1 .In the INVITE packet which is being sent from kamailio server to MSC, it
is coming Request-Line: INVITE sip:0730092190@*172.22.14.12*
   That is my kamailio server IP and it should be MSC IP(172.28.0.68) and
as of now call is failing as MSC is sending 404 error.
2. Other issue is , in the pcap file it is coming SIP/SDP as protocol and
it is not coming SIP-I.

Please find the latest attached pcap.

Regards,
Sandeep


Warm Regards,
Sandeep Chakravarthi.

On Tue, Aug 11, 2015 at 9:47 PM, SamyGo govoi...@gmail.com wrote:

 Thats because your configuration file is not sending packet out (RELAY) to
 MSC instead it is only doing a Loadbalancer / destination lookup in
 TOASTERISK route and comes out of it, processes the following routes in
 order
   route(SIPOUT);
   route(PRESENCE);
   route(REGISTRAR);
   route(PSTN);
   route(LOCATION);

 Where finally in LOCATION route it tries to find the destination user
 0730092190 online locally on Kamailio, which it can't find and says 404 Not
 Found.

 You should modify your TOASTERISK route as follow:

 route[TOASTERISK] {
 if(ds_is_from_list(2)) {
 #Call from Telco Should goto Asterisk pool in Loadbalanced mode
  if(!ds_select_dst(1, 4)) {
 sl_send_reply(500, Service Unavailable);
 xlog(L_INFO,[$fU@$si:$sp]{$rm} No destinations
 available for $rd \n);
 exit;
 }
 route(RELAY);
 }if(ds_is_from_list(1)) {
 #Call from Asterisk servers pool, send it to telco using LoadBalancer
 if(!ds_select_dst(2, 4)) {
 sl_send_reply(500, Service Unavailable);
 xlog(L_INFO,[$fU@$si:$sp]{$rm} No destinations
 available for $rd \n);
 exit;
 }
 route(RELAY);
  }

 }


 This will immediately route the packet out towards the new $du after the
 loadbalancer function ds_select_dst(...)


 On Tue, Aug 11, 2015 at 10:48 AM, Sandeep Chakravarthi 
 ivschakravar...@gmail.com wrote:

 Hi,
 Kamailio  is sending 404 Response and its not MSC.
 If you see the pcap file , Kamailio has to forward the SIP invite packet
 to MSC which it got from Asterisk server. But it is not happening.
 I am attaching the pcap one more time for your reference.

 In my pcap, below are the server details

 172.22.14.12 - Kamailio server
 172.22.14.17 - Asterisk server
 172.22.0.68 - MSC


 Regards,
 Sandeep

 Warm Regards,
 Sandeep Chakravarthi.

 On Tue, Aug 11, 2015 at 7:10 PM, SamyGo govoi...@gmail.com wrote:

 Hi Sandeep,
 what is the problem here ? Kamailio just sends a 404 on its own or is
 really sending calls to MSC and MSC is replying with 404 ?


 On Mon, Aug 10, 2015 at 12:33 PM, Sandeep Chakravarthi 
 ivschakravar...@gmail.com wrote:

 Hi ,
 Sorry for the delayed reply.
 I have configured my Asterisk and kamailio server, but when i initiate
 one outbound call from my asterisk server to kamailio server, kamailio
 server is initiating the call to MSC.
 Please find the attached pcap details for your reference.
 Below is my kamailio debug log and kamailio.cfg file.
 Please check the pcap and below cfg file and log file and let me know
 whether to change anything in cfg file or not.

 


 request_route {

 # per request initial checks
 route(REQINIT);

 # NAT detection
 route(NATDETECT);

 # CANCEL processing
 if (is_method(CANCEL))
 {
 if (t_check_trans()) {
 route(RELAY);
 }
 exit;
 }

 # handle requests within SIP dialogs
 route(WITHINDLG);

 ### only initial requests (no To tag)

 t_check_trans();

 # authentication
 route(AUTH);


 # record routing for dialog forming requests (in case they are
 routed)
 # - remove preloaded route headers
 remove_hf(Route);
 if (is_method(INVITE|SUBSCRIBE))
 record_route();

 # account only INVITEs
 if (is_method(INVITE))
 {
 setflag(FLT_ACC); # do accounting
 }
 route(TOASTERISK);

 # dispatch requests to foreign domains
 route(SIPOUT);

 ### requests for my local domains

 # handle presence related requests
 route(PRESENCE);

 # handle registrations
 route(REGISTRAR);

 if ($rU==$null)
 {
 # request with no Username in RURI
 sl_send_reply(484,Address Incomplete);
 exit;
 }

 # dispatch destinations to PSTN
 route(PSTN);
 # user location service
 route(LOCATION);
 }

 route[TOASTERISK] {
 if(ds_is_from_list(2)) {
 #Call from Telco