[SR-Users] new URI [] shorter than old URI - error

2016-12-21 Thread Nelson Migliaro
Hello,

My SIP vendor request me to replace the from in order to authenticate calls.

I use:

uac_replace_from("1", "sip:11...@vendor-domain.com");

And when finishing calls I have this error:

ERROR: uac [replace.c:607]: restore_uri(): new URI [] shorter than old URI
[sip:34912345678@vendor-public-ip]

Information
--
34912345678 -> original CLI
1 -> my vendor contract
vendor-domain.com -> domain of the vendor
--

I use the function uac_replace_from in the request_route

My Kamailio version is: 4.2.8-1.1

Thank you

Nelson.-
___
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] Change from in a failure route

2016-11-22 Thread Nelson Migliaro
Hello,

My sip vendor sends me a 403 error when the caller id (CLI) sent is not
valid.

I would like to set up a failure route to capture that 403 and set up a
default CLI.

I tried to use a uac_replace_from() in a failure route but I get:

"Command cannot be used in the block"

Does anyone know how can I change the CLI in a failure route how how can
achieve the default CLI?

Thank you
___
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] Change CLID

2016-11-09 Thread Nelson Migliaro
Hello,

I have several SIP vendors and I must present a different CLID for each of
them.

I am planning to use failure routers in Kamailio to route calls to a
different vendor in case of failure.

The problem I face is changing clid in each route.

I am planning to use a mysql database to select the clid based on a prefix
and sip vendor and in case of failure, select new clid base on new sip
vendor.

Is mysql the right way to do that, is there a module for this?
In order to change the clid I am thinking of
using: uac_replace_to(display,uri). Is this correct way to do that?

And finally, in case of using uac_replace_to(display,uri), do I have to
use uac_restore_from() to restone the correct from to avoid further issues?

Thank you in advance

Nelson.-
___
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] BYE issue

2016-10-18 Thread Nelson Migliaro
Thank you very much for your support,

When you say: "They may be able to disable this for you – otherwise you’ll
need to rewrite the headers yourself."

How can I rewrite the header if I dont have destination IP?, there are four
Asterisk servers and all of them send calls to the bridged Kamailio and I
dont have Asterisk private IP in the BYE request.

Regards and again thank you,

Nelson.-

2016-10-18 9:18 GMT+02:00 Phil Lavin <phil.la...@cloudcall.com>:

> It sounds like the vendor is handling NAT traversal on their side. They
> will be assuming that Asterisk is behind NAT, because of the presence of
> private IP addresses – particularly in the contact, and will be rewriting
> various parts.
>
>
>
> They may be able to disable this for you – otherwise you’ll need to
> rewrite the headers yourself.
>
>
>
>
>
> *From:* sr-users [mailto:sr-users-boun...@lists.sip-router.org] *On
> Behalf Of *Nelson Migliaro
> *Sent:* 17 October 2016 18:23
> *To:* Kamailio (SER) - Users Mailing List <sr-users@lists.sip-router.org>
> *Subject:* [SR-Users] BYE issue
>
>
>
> Hello everybody,
>
>
>
> I am having issues with one SIP vendor.
>
>
>
> I have a Kamailio in bridge mode (private IP / Public IP) and some
> Asterisk and Media Gateways.
>
>
>
> Calls get established and I have two way audio but when the remote party
> hangs up the call, the BYE arrives to the Kamailio and does not move
> forward.
>
>
>
> I think the problem is SIP vendor rewrite the BYE header and change the
> asterisk IP with the public IP of the kamailio.
>
>
>
> The IP that appears in the header of the BYE have to be the same that
> appears in the contact (UAC that send the call, in my case the Asterisk).
> Vendor should not change that IP. ¿Am I correct?
>
>
>
> Thank you
>
>
>
> 
> -
>
> INVITE
>
> 
> 
>
> 2016/10/17 18:50:49.110967 PUBLIC-KAMAILIO-IP:5060 -> VENDOR-IP:6060
>
> INVITE sip:DESTINATION-NUMBER@VENDOR-IP:6060 SIP/2.0
>
> Record-Route: <sip:PUBLIC-KAMAILIO-IP;r2=on;lr=on;ftag=as5e87b96c;vsf=
> AABQUk9fRVYAU0UuODY-;vst=AAQEAw8MDgsAAHYAcVddXkZWRV
> VDVl1MMDIudm9pY2U
>
> G9jYWw-;did=09b.9572;nat=yes>
>
> Record-Route: <sip:PRIVATE-KAMAILIO-IP;r2=on;lr=on;ftag=as5e87b96c;vsf=
> AABQUk9fRVYAU0UuODY-;vst=AAQEAw8MDgsAAHYAcVddXkZWRV
> VDVl1MMDIudm9pY2U
>
> G9jYWw-;did=09b.9572;nat=yes>
>
> Via: SIP/2.0/UDP PUBLIC-KAMAILIO-IP;branch=z9hG4bK06a.
> 07540d0e2f32a811ecf9c0a5235dc77a.1
>
> Via: SIP/2.0/UDP PRIVATE-ASTERISK-IP:5060;received=PRIVATE-ASTERISK-IP;
> branch=z9hG4bK6bb5a7b3;rport=5060
>
> Max-Forwards: 69
>
> From: "SOURCE-NUMBER" <sip:SOURCE-NUMBER@MY-COMPANY>;tag=as5e87b96c
>
> To: <sip:DESTINATION-NUMBER@VENDOR-IP>
>
> Contact: <sip:SOURCE-NUMBER@PRIVATE-ASTERISK-IP:5060>
>
> Call-ID: 025cc3717ba59faa000cf4db6f8be588@PRIVATE-ASTERISK-IP:5060
>
> CSeq: 102 INVITE
>
> User-Agent: UAC
>
> Date: Mon, 17 Oct 2016 16:53:35 GMT
>
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
> PUBLISH, MESSAGE
>
> Supported: replaces, timer
>
> Content-Type: application/sdp
>
> Content-Length: 269
>
>
>
> v=0
>
> o=root 292850421 292850421 IN IP4 PUBLIC-KAMAILIO-IP
>
> s=Asterisk PBX
>
> c=IN IP4 PUBLIC-KAMAILIO-IP
>
> t=0 0
>
> m=audio 23456 RTP/AVP 18 101
>
> a=rtpmap:18 G729/8000
>
> a=fmtp:18 annexb=no
>
> a=rtpmap:101 telephone-event/8000
>
> a=fmtp:101 0-16
>
> a=ptime:20
>
> a=sendrecv
>
> a=nortpproxy:yes
>
>
>
> 
> -
>
> BYE
>
> 
> -
>
> 2016/10/17 18:50:58.241666 VENDOR-IP:6060 -> PUBLIC-KAMAILIO-IP:5060
>
> BYE sip:SOURCE-NUMBER@PUBLIC-KAMAILIO-IP:5060 SIP/2.0
>
> Via: SIP/2.0/UDP VENDOR-IP:6060;branch=z9hG4bKeff4.48943e76.0
>
> Via: SIP/2.0/UDP VENDOR-IP:5060;branch=z9hG4bK1d4e605e4ll19f74fBYE421
> ce8658050206
>
> Max-Forwards: 34
>
> Route: <sip:PUBLIC-KAMAILIO-IP;lr;r2=on;ftag=as5e87b96c;vsf=
> AABQUk9fRVYAU0UuODY-;vst=AAQEAw8MDgsAAHYAcVddXkZWRV
> VDVl1>
>
> Route: <sip:PRIVATE-KAMAILIO-IP;lr;r2=on;ftag=as5e87b96c;vsf=
> AABQUk9fRVYAU0UuODY-;vst=AAQEAw8MDgsAAHYAcVddXkZWRV
> 

[SR-Users] BYE issue

2016-10-17 Thread Nelson Migliaro
Hello everybody,

I am having issues with one SIP vendor.

I have a Kamailio in bridge mode (private IP / Public IP) and some Asterisk
and Media Gateways.

Calls get established and I have two way audio but when the remote party
hangs up the call, the BYE arrives to the Kamailio and does not move
forward.

I think the problem is SIP vendor rewrite the BYE header and change the
asterisk IP with the public IP of the kamailio.

The IP that appears in the header of the BYE have to be the same that
appears in the contact (UAC that send the call, in my case the Asterisk).
Vendor should not change that IP. ¿Am I correct?

Thank you

-
INVITE

2016/10/17 18:50:49.110967 PUBLIC-KAMAILIO-IP:5060 -> VENDOR-IP:6060
INVITE sip:DESTINATION-NUMBER@VENDOR-IP:6060 SIP/2.0
Record-Route:

Record-Route:

Via: SIP/2.0/UDP
PUBLIC-KAMAILIO-IP;branch=z9hG4bK06a.07540d0e2f32a811ecf9c0a5235dc77a.1
Via: SIP/2.0/UDP
PRIVATE-ASTERISK-IP:5060;received=PRIVATE-ASTERISK-IP;branch=z9hG4bK6bb5a7b3;rport=5060
Max-Forwards: 69
From: "SOURCE-NUMBER" ;tag=as5e87b96c
To: 
Contact: 
Call-ID: 025cc3717ba59faa000cf4db6f8be588@PRIVATE-ASTERISK-IP:5060
CSeq: 102 INVITE
User-Agent: UAC
Date: Mon, 17 Oct 2016 16:53:35 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 269

v=0
o=root 292850421 292850421 IN IP4 PUBLIC-KAMAILIO-IP
s=Asterisk PBX
c=IN IP4 PUBLIC-KAMAILIO-IP
t=0 0
m=audio 23456 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=nortpproxy:yes

-
BYE
-
2016/10/17 18:50:58.241666 VENDOR-IP:6060 -> PUBLIC-KAMAILIO-IP:5060
BYE sip:SOURCE-NUMBER@PUBLIC-KAMAILIO-IP:5060 SIP/2.0
Via: SIP/2.0/UDP VENDOR-IP:6060;branch=z9hG4bKeff4.48943e76.0
Via: SIP/2.0/UDP
VENDOR-IP:5060;branch=z9hG4bK1d4e605e4ll19f74fBYE421ce8658050206
Max-Forwards: 34
Route:

Route:

To: "SOURCE-NUMBER";tag=as5e87b96c
From: ;tag=421ce86-co1547-INS001
Call-ID: 025cc3717ba59faa000cf4db6f8be588@PRIVATE-ASTERISK-IP:5060
CSeq: 154701 BYE
User-Agent: VENDOR
Content-Length: 0

-
___
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] Insert callerid in Kamailio

2016-04-06 Thread Nelson Migliaro
Hello,

I am planning to insert the caller id in my Kamailio before sending the
call to sip vendor.

I am planning to send a prefix before the number and use that prefix in the
SQL query to select the CLID. I was thinking in the sqlops to select the
CLID and then append the result in the Remote-Party-ID:

modparam("sqlops","sqlcon","cb=>mysql://kamailio:abc@10.10.1.1/testdb")
modparam("sqlops","sqlcon","ca=>dbdriver://username:password@dbhost/dbname")
...

...
sql_query("ca", "select clid from mitable where prefix = $var(prefix)", "ra");
xlog("number of rows in table domain: $dbr(ra=>rows)\n");
sql_result_free("ra");

Question.

¿Is there an specific module to do this or a there a better way?

Thank you

Nelson.-
___
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] Fwd: acc_cdrs empty

2016-03-31 Thread Nelson Migliaro
Resolved, due to a routing error, dialog flag was not being activated
setflag(4);


-- Forwarded message --
From: Nelson Migliaro <eng.migli...@gmail.com>
Date: 2016-03-30 23:50 GMT+02:00
Subject: acc_cdrs empty
To: "Kamailio (SER) - Users Mailing List" <sr-users@lists.sip-router.org>


Hello,

I am not able to set up cdr.

I see acc table is updated with 2 new entries after each call (INVITE and
BYE) but acc_cdrs is empty.

There are errors in the log.

I think that I set up everything but is not working,

- load the module, set module params and set the flag? Am I missing
something, should I use a store procedure or something?




loadmodule "acc.so"

modparam("acc", "early_media", 0)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 0)
modparam("acc", "detect_direction", 1)

modparam("acc", "db_flag", FLT_ACC)
modparam("acc", "db_missed_flag", FLT_ACCMISSED)
modparam("acc", "db_url", DBURL)

modparam("acc", "cdr_enable", 1)
modparam("acc", "cdr_start_on_confirmed", 1)
modparam("acc", "cdrs_table", "acc_cdrs")
modparam("acc", "cdr_start_id", "start_time")
modparam("acc", "cdr_end_id", "end_time")
modparam("acc", "cdr_duration_id", "duration")

if (is_method("INVITE")) {
setflag(FLT_ACC); # do accounting
}

route[WITHINDLG] {
if (has_totag()) {
if (loose_route()) {
route(DLGURI);
if (is_method("BYE")) {


CREATE TABLE `acc_cdrs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `start_time` varchar(32) NOT NULL DEFAULT '',
  `end_time` varchar(32) NOT NULL DEFAULT '',
  `duration` varchar(32) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `start_time_idx` (`start_time`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1$$


Thank you.
___
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 Bridge

2016-03-23 Thread Nelson Migliaro
Resolved.there was an error in my cofniguration.

Thank you

2016-03-21 15:17 GMT+01:00 Nelson Migliaro <eng.migli...@gmail.com>:

> Hello,
>
> I am trying to set up a Kamailio in Bridge Mode with two interfaces using
> rtpproxy.
>
> The problem I have is SDP information port and IP is not updated from
> outside to inside. But on the other hand the SDP is rewrited from inside to
> outside.
>
> In the rtpproxy log I am seeing this error:
>
> Mar 21 14:21:21 kamailio rtpproxy[6119]: ERR:create_twinlistener: can't
> bind to the IPv4 port 23414: Cannot assign requested address
> Mar 21 14:21:21 kamailio rtpproxy[6119]: ERR:handle_command: can't create
> listener
>
> and in kamailio log:
>
> ERROR: rtpproxy [rtpproxy.c:2727]: force_rtp_proxy(): incorrect port 0 in
> reply from rtp proxy
>
>
> Something strange and interesting is the port that shows up in the
> RTPPROXY error (23414) does not corresponds to any ports used.
>
> Thank you
>
> Nelson.-
>
>
>
> -
> Everything is set up this way:
>
> Kamailio
>
> Asterisk (asterisk-inside-ip) <-> Kamailio (inside-kamailio-ip) / Kamailio
> (outside-kamailio-ip) <-> sip-vendor-ip
>
> listen=inside-kamailio-ip
> listen=outside-kamailio-ip
>
> mhomed=1
>
> if(src_ip=="asterisk-inside-ip"){
> rtpproxy_manage("faie");
> }
>
> if(src_ip=="sip-vendor-ip"){
> rtpproxy_manage("faie");
> }
>
> rtpproxy
>
> OPTIONS="rtpproxy -l inside-kamailio-ip/outside-kamailio-ip -m 2 -M
> 3 -u rtpproxy:rtpproxy -p /var/run/rtpproxy/rtpproxy.pid -s udp:
> 127.0.0.1:7722 -d DBUG:LOG_LOCAL6"
>
>
> --
>
> SIP TRACES
>
> 2016/03/21 14:46:52.121472 asterisk-inside-ip:5060 ->
> inside-kamailio-ip:5060
> INVITE sip:9@inside-kamailio-ip SIP/2.0
> Via: SIP/2.0/UDP asterisk-inside-ip:5060;branch=z9hG4bK7f1ece8e;rport
> Max-Forwards: 70
> From: 1<sip:1000@asterisk-inside-ip>;tag=as497457e6
> To: <sip:9@inside-kamailio-ip>
> Contact: <sip:1000@asterisk-inside-ip:5060>
> Call-ID: 57bd4ca457972f5a42502ba34bba4500@asterisk-inside-ip:5060
> CSeq: 102 INVITE
> User-Agent: Abantix
> Date: Mon, 21 Mar 2016 13:46:52 GMT
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
> PUBLISH
> Supported: replaces, timer
> Remote-Party-ID: <sip:8@local-domain
> ;user=phone>;privacy=off;party=calling
> Content-Type: application/sdp
> Content-Length: 251
>
> v=0
> o=root 478097443 478097443 IN IP4 asterisk-inside-ip ##
> ASTERISK IP
> s=asterisk
> c=IN IP4 asterisk-inside-ip## ASTERISK IP
> t=0 0
> m=audio 17146 RTP/AVP 8 101## ASTERISK PORT
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=silenceSupp:off - - - -
> a=ptime:20
> a=sendrecv
>
>
> 
>
>
> 2016/03/21 14:46:52.139435 outside-kamailio-ip:5060 ->sip-vendor-ip:5060
> INVITE sip:9@sip-vendor-ip SIP/2.0
> Record-Route:
> <sip:outside-kamailio-ip;r2=on;lr=on;ftag=as497457e6;vsf=AAMECXIEAW5fXkFYWUwAUkM-;vst=AAcHAw8MDgsAAHZBKUEeQF5DRUFMGEtCMDY-;nat=yes>
> Record-Route:
> <sip:inside-kamailio-ip;r2=on;lr=on;ftag=as497457e6;vsf=AAMECXIEAW5fXkFYWUwAUkM-;vst=AAcHAw8MDgsAAHZBKUEeQF5DRUFMGEtCMDY-;nat=yes>
> Via: SIP/2.0/UDP
> outside-kamailio-ip;branch=z9hG4bK0bfd.7bd4d3ae01e5850c14a3a939a612a05a.0
> Via: SIP/2.0/UDP
> asterisk-inside-ip:5060;received=asterisk-inside-ip;branch=z9hG4bK7f1ece8e;rport=5060
> Max-Forwards: 69
> From: 11 <sip:11@sip-vendor-ip>;tag=as497457e6
> To: <sip:99...@sip.sip-vendor-ip>
> Contact: <sip:1000@asterisk-inside-ip:5060>
> Call-ID: 57bd4ca457972f5a42502ba34bba4500@asterisk-inside-ip:5060
> CSeq: 102 INVITE
> User-Agent: Abantix Voice Sevices
> Date: Mon, 21 Mar 2016 13:46:52 GMT
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
> PUBLISH
> Supported: replaces, timer
> Remote-Party-ID: <sip:8@local-domain
> ;user=phone>;privacy=off;party=calling
&g

[SR-Users] Kamailio Bridge

2016-03-21 Thread Nelson Migliaro
Hello,

I am trying to set up a Kamailio in Bridge Mode with two interfaces using
rtpproxy.

The problem I have is SDP information port and IP is not updated from
outside to inside. But on the other hand the SDP is rewrited from inside to
outside.

In the rtpproxy log I am seeing this error:

Mar 21 14:21:21 kamailio rtpproxy[6119]: ERR:create_twinlistener: can't
bind to the IPv4 port 23414: Cannot assign requested address
Mar 21 14:21:21 kamailio rtpproxy[6119]: ERR:handle_command: can't create
listener

and in kamailio log:

ERROR: rtpproxy [rtpproxy.c:2727]: force_rtp_proxy(): incorrect port 0 in
reply from rtp proxy


Something strange and interesting is the port that shows up in the RTPPROXY
error (23414) does not corresponds to any ports used.

Thank you

Nelson.-


-
Everything is set up this way:

Kamailio

Asterisk (asterisk-inside-ip) <-> Kamailio (inside-kamailio-ip) / Kamailio
(outside-kamailio-ip) <-> sip-vendor-ip

listen=inside-kamailio-ip
listen=outside-kamailio-ip

mhomed=1

if(src_ip=="asterisk-inside-ip"){
rtpproxy_manage("faie");
}

if(src_ip=="sip-vendor-ip"){
rtpproxy_manage("faie");
}

rtpproxy

OPTIONS="rtpproxy -l inside-kamailio-ip/outside-kamailio-ip -m 2 -M
3 -u rtpproxy:rtpproxy -p /var/run/rtpproxy/rtpproxy.pid -s udp:
127.0.0.1:7722 -d DBUG:LOG_LOCAL6"

--

SIP TRACES

2016/03/21 14:46:52.121472 asterisk-inside-ip:5060 ->
inside-kamailio-ip:5060
INVITE sip:9@inside-kamailio-ip SIP/2.0
Via: SIP/2.0/UDP asterisk-inside-ip:5060;branch=z9hG4bK7f1ece8e;rport
Max-Forwards: 70
From: 1;tag=as497457e6
To: 
Contact: 
Call-ID: 57bd4ca457972f5a42502ba34bba4500@asterisk-inside-ip:5060
CSeq: 102 INVITE
User-Agent: Abantix
Date: Mon, 21 Mar 2016 13:46:52 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH
Supported: replaces, timer
Remote-Party-ID: ;privacy=off;party=calling
Content-Type: application/sdp
Content-Length: 251

v=0
o=root 478097443 478097443 IN IP4 asterisk-inside-ip ##
ASTERISK IP
s=asterisk
c=IN IP4 asterisk-inside-ip## ASTERISK IP
t=0 0
m=audio 17146 RTP/AVP 8 101## ASTERISK PORT
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv




2016/03/21 14:46:52.139435 outside-kamailio-ip:5060 ->sip-vendor-ip:5060
INVITE sip:9@sip-vendor-ip SIP/2.0
Record-Route:

Record-Route:

Via: SIP/2.0/UDP
outside-kamailio-ip;branch=z9hG4bK0bfd.7bd4d3ae01e5850c14a3a939a612a05a.0
Via: SIP/2.0/UDP
asterisk-inside-ip:5060;received=asterisk-inside-ip;branch=z9hG4bK7f1ece8e;rport=5060
Max-Forwards: 69
From: 11 ;tag=as497457e6
To: 
Contact: 
Call-ID: 57bd4ca457972f5a42502ba34bba4500@asterisk-inside-ip:5060
CSeq: 102 INVITE
User-Agent: Abantix Voice Sevices
Date: Mon, 21 Mar 2016 13:46:52 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH
Supported: replaces, timer
Remote-Party-ID: ;privacy=off;party=calling
Content-Type: application/sdp
Content-Length: 271

v=0
o=root 478097443 478097443 IN IP4 outside-kamailio-ip ## OUTSIDE
KAMAILIO IP REWRITED BY RTPPROXY
s=asterisk
c=IN IP4 outside-kamailio-ip## OUTSIDE KAMAILIO IP REWRITED
BY RTPPROXY
t=0 0
m=audio 24122 RTP/AVP 8 101## OUTSIDE KAMAILIO PORT
REWRITED BY RTPPROXY
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv





2016/03/21 14:46:57.393518sip-vendor-ip:5060 -> outside-kamailio-ip:5060
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP
outside-kamailio-ip;rport=5060;branch=z9hG4bK0bfd.7bd4d3ae01e5850c14a3a939a612a05a.1
Via: SIP/2.0/UDP
asterisk-inside-ip:5060;received=asterisk-inside-ip;branch=z9hG4bK7f1ece8e;rport=5060
From: 11 ;tag=as497457e6
To: 

Re: [SR-Users] Fwd: Kamailio and NAT

2016-01-20 Thread Nelson Migliaro
>From what I saw, Nat´d por does not change. It always use 52548.

Questions:

1 - In order to get rport, as you mentioned, i can use transformation.
¿What variable / pseudovariable I can use to get a string that contains
rport?

2 - After I get that info, what would be the best way to insert that info
in kamailio.cfg file

3 - After updating the file in some way, how can I restart the service?

and last but not least, Is there a more elegant way to do this? I am
feeling like reinvent the wheel.

Thank you for all your support



2016-01-19 19:06 GMT+01:00 Daniel-Constantin Mierla <mico...@gmail.com>:

> To get rport you can use transformations.
>
> If you restart kamailio, is the firewall preserving the same value for
> rport?
>
> Cheers,
> Daniel
>
> On 19/01/16 18:18, Nelson Migliaro wrote:
> > I am thinking that I cat get the port during the first call and then
> > use that port for the rest of calls.
> > Maybe that first call will fail but after that, all calls will go fine.
> >
> > Example of a Trying showing received port: 52548
> >
> > ¿Do you know what pseudovariable represent that value?
> >
> > I tested with all variables I could find but I could not find anyone.
> >
> > Thank you
> >
> >
> -
> >
> >
> >
> > 2016/01/19 17:38:38.981987 VENDOR-IP:5060 -> KAMAILIO-IP:5060
> > SIP/2.0 100 trying -- your call is important to us
> > Via: SIP/2.0/UDP
> >
> PUBLIC-IP:52548;branch=z9hG4bK8b5c.b122371ac0ac2f3ef3204b0f192cb16c.1;rport=52548
> > Via: SIP/2.0/UDP
> > ASTERISK-IP:5060;received=ASTERISK-IP;branch=z9hG4bK4082d124;rport=5060
> > From: 8 <sip:8@ASTERISK-IP>;tag=as34f971fe
> > To: <sip:9@VENDOR-DOMAIN>
> > Call-ID: 0b5307fa290674a97b47970643fce42a@ASTERISK-IP:5060
> > CSeq: 102 INVITE
> > Server: kamailio
> > Content-Length: 0
> >
> >
>
> --
> Daniel-Constantin Mierla
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Book: SIP Routing With Kamailio - http://www.asipto.com
> http://miconda.eu
>
>
> ___
> 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
>
___
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] Fwd: Kamailio and NAT

2016-01-19 Thread Nelson Migliaro
I am thinking that I cat get the port during the first call and then use
that port for the rest of calls.
Maybe that first call will fail but after that, all calls will go fine.

Example of a Trying showing received port: 52548

¿Do you know what pseudovariable represent that value?

I tested with all variables I could find but I could not find anyone.

Thank you

-



2016/01/19 17:38:38.981987 VENDOR-IP:5060 -> KAMAILIO-IP:5060
SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP
PUBLIC-IP:52548;branch=z9hG4bK8b5c.b122371ac0ac2f3ef3204b0f192cb16c.1;rport=52548
Via: SIP/2.0/UDP
ASTERISK-IP:5060;received=ASTERISK-IP;branch=z9hG4bK4082d124;rport=5060
From: 8 <sip:8@ASTERISK-IP>;tag=as34f971fe
To: <sip:9@VENDOR-DOMAIN>
Call-ID: 0b5307fa290674a97b47970643fce42a@ASTERISK-IP:5060
CSeq: 102 INVITE
Server: kamailio
Content-Length: 0


2016-01-15 9:50 GMT+01:00 Nelson Migliaro <eng.migli...@gmail.com>:

> Hello Daniel,
>
> Yes, I am registered to the vendor.
>
> Regards,
>
> Nelson.-
>
> 2016-01-15 7:58 GMT+01:00 Daniel-Constantin Mierla <mico...@gmail.com>:
>
>> Ahh, I thought Asterisk is in the public internet, but actually you
>> connect to a provider (vendor), which seems to run Kamailio as well.
>>
>> Using information from 100 trying is too late, as the INVITE was already
>> sent... so one more question before trying to propose a solution. Do you
>> have to register to the provider?
>>
>> Cheers,
>> Daniel
>>
>>
>> On 14/01/16 18:51, Nelson Migliaro wrote:
>>
>> Yes it is possible, but is there an easy way to workaround the issue
>> using Kamailio.
>>
>> Because I have the port because vendor is sending that info in Trying:
>>
>> 2016/01/13 20:10:15.842055 VENDOR-IP:5060 -> PRIVATE-IP-KAMAILIO:5060
>> SIP/2.0 100 trying -- your call is important to us
>> Via: SIP/2.0/UDP PUBLIC-IP:52548;branch=
>> z9hG4bKdd74.992e238037882e809653f713a5a580a9.1;rport=*52548*
>>
>> I need to find the way to discover the port used by firewall (maybe
>> getting that info from Trying) and then advertise that port.
>>
>>
>>
>> 2016-01-14 18:32 GMT+01:00 Daniel-Constantin Mierla < <mico...@gmail.com>
>> mico...@gmail.com>:
>>
>>> Not really up to date with all Asterisk features -- do you know if you
>>> can append a custom header to a SIP response that is going to be generated
>>> by Asterisk? Eventually the reply for an OPTIONS request.
>>>
>>> Cheers,
>>> Daniel
>>>
>>>
>>> On 14/01/16 17:19, Nelson Migliaro wrote:
>>>
>>> Yes, I manage all devices, even the internet router but it does not
>>> allow static pat.
>>>
>>> 2016-01-14 16:07 GMT+01:00 Daniel-Constantin Mierla <mico...@gmail.com>:
>>>
>>>> Do you control the Asterisk? If yes, depending on Asterisk capabilities
>>>> of building replies, you may be able to do some automation to detect the
>>>> external port.
>>>>
>>>> Cheers,
>>>> Daniel
>>>>
>>>> On Thu, Jan 14, 2016 at 3:47 PM, Nelson Migliaro <
>>>> <eng.migli...@gmail.com>eng.migli...@gmail.com> wrote:
>>>>
>>>>> There is not a public Kamailio, only one Kamailio behind NAT,
>>>>>
>>>>> Right now the configuration is:
>>>>>
>>>>> Asterisk <-> Kamailio (Private IP + advertise public IP + RTP Proxy  )
>>>>> <-> Internet router (public IP + symmetric na) <-> Internet
>>>>>
>>>>> Regards,
>>>>>
>>>>> 2016-01-14 15:43 GMT+01:00 Daniel-Constantin Mierla <
>>>>> <mico...@gmail.com>mico...@gmail.com>:
>>>>>
>>>>>> Is the kamailio behind nat communicating with another kamailio on a
>>>>>> public IP?
>>>>>>
>>>>>> Cheers,
>>>>>> DAniel
>>>>>>
>>>>>> On Thu, Jan 14, 2016 at 1:33 PM, Nelson Migliaro <
>>>>>> <eng.migli...@gmail.com>eng.migli...@gmail.com> wrote:
>>>>>>
>>>>>>> Thank you Daniel for your answer,
>>>>>>>
>>>>>>> As you mention, there is a symmetric nat and router does not allow a
>>>>>>> static NAT.
>&

Re: [SR-Users] Fwd: Kamailio and NAT

2016-01-14 Thread Nelson Migliaro
Yes it is possible, but is there an easy way to workaround the issue using
Kamailio.

Because I have the port because vendor is sending that info in Trying:

2016/01/13 20:10:15.842055 VENDOR-IP:5060 -> PRIVATE-IP-KAMAILIO:5060
SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP PUBLIC-IP:52548;branch=
z9hG4bKdd74.992e238037882e809653f713a5a580a9.1;rport=*52548*

I need to find the way to discover the port used by firewall (maybe getting
that info from Trying) and then advertise that port.



2016-01-14 18:32 GMT+01:00 Daniel-Constantin Mierla <mico...@gmail.com>:

> Not really up to date with all Asterisk features -- do you know if you can
> append a custom header to a SIP response that is going to be generated by
> Asterisk? Eventually the reply for an OPTIONS request.
>
> Cheers,
> Daniel
>
>
> On 14/01/16 17:19, Nelson Migliaro wrote:
>
> Yes, I manage all devices, even the internet router but it does not allow
> static pat.
>
> 2016-01-14 16:07 GMT+01:00 Daniel-Constantin Mierla < <mico...@gmail.com>
> mico...@gmail.com>:
>
>> Do you control the Asterisk? If yes, depending on Asterisk capabilities
>> of building replies, you may be able to do some automation to detect the
>> external port.
>>
>> Cheers,
>> Daniel
>>
>> On Thu, Jan 14, 2016 at 3:47 PM, Nelson Migliaro <
>> <eng.migli...@gmail.com>eng.migli...@gmail.com> wrote:
>>
>>> There is not a public Kamailio, only one Kamailio behind NAT,
>>>
>>> Right now the configuration is:
>>>
>>> Asterisk <-> Kamailio (Private IP + advertise public IP + RTP Proxy  )
>>> <-> Internet router (public IP + symmetric na) <-> Internet
>>>
>>> Regards,
>>>
>>> 2016-01-14 15:43 GMT+01:00 Daniel-Constantin Mierla <mico...@gmail.com>:
>>>
>>>> Is the kamailio behind nat communicating with another kamailio on a
>>>> public IP?
>>>>
>>>> Cheers,
>>>> DAniel
>>>>
>>>> On Thu, Jan 14, 2016 at 1:33 PM, Nelson Migliaro <
>>>> <eng.migli...@gmail.com>eng.migli...@gmail.com> wrote:
>>>>
>>>>> Thank you Daniel for your answer,
>>>>>
>>>>> As you mention, there is a symmetric nat and router does not allow a
>>>>> static NAT.
>>>>>
>>>>> By sniffing traffic I can see the port is using new but in case it
>>>>> change, how can automate the process of advertising the correct port?
>>>>>
>>>>> Cheers!
>>>>>
>>>>>
>>>>> -- Forwarded message --
>>>>> From: Daniel-Constantin Mierla < <mico...@gmail.com>mico...@gmail.com>
>>>>> Date: 2016-01-13 23:28 GMT+01:00
>>>>> Subject: Re: [SR-Users] Kamailio and NAT
>>>>> To: "Kamailio (SER) - Users Mailing List" <
>>>>> <sr-users@lists.sip-router.org>sr-users@lists.sip-router.org>
>>>>>
>>>>>
>>>>> Hello,
>>>>>
>>>>> it looks like you have a symmetric nat router, so the allocated port
>>>>> is randomly selected.
>>>>>
>>>>> If you don't control the nat router to set a static forwarding rule or
>>>>> it doesn't provide the option to set static forwarding, then you are 
>>>>> pretty
>>>>> much left with sniffing the traffic to discover the external port and
>>>>> advertise it.
>>>>>
>>>>> Cheers,
>>>>> Daniel
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On 13/01/16 20:31, Nelson Migliaro wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I finally were able to run my Kamailio behind NAT but in order to
>>>>> accomplish that I included:
>>>>>
>>>>> listen=udp:SOURCE-IP:5060 advertise PUBLIC-IP:52548
>>>>>
>>>>> 52548 is the port my internet router change when doing NAT
>>>>> (5060->52548). I found this port sniffing traffic
>>>>>
>>>>> Conclusions at this point are:
>>>>>
>>>>>
>>>>> -1--
>>>>> If I use this line:
>>>>>
>>>>> listen=udp:SOURCE-IP:5060 advertise PUBLIC-IP:50

[SR-Users] Fwd: Kamailio and NAT

2016-01-14 Thread Nelson Migliaro
Thank you Daniel for your answer,

As you mention, there is a symmetric nat and router does not allow a static
NAT.

By sniffing traffic I can see the port is using new but in case it change,
how can automate the process of advertising the correct port?

Cheers!


-- Forwarded message --
From: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2016-01-13 23:28 GMT+01:00
Subject: Re: [SR-Users] Kamailio and NAT
To: "Kamailio (SER) - Users Mailing List" <sr-users@lists.sip-router.org>


Hello,

it looks like you have a symmetric nat router, so the allocated port is
randomly selected.

If you don't control the nat router to set a static forwarding rule or it
doesn't provide the option to set static forwarding, then you are pretty
much left with sniffing the traffic to discover the external port and
advertise it.

Cheers,
Daniel




On 13/01/16 20:31, Nelson Migliaro wrote:

Hello,

I finally were able to run my Kamailio behind NAT but in order to
accomplish that I included:

listen=udp:SOURCE-IP:5060 advertise PUBLIC-IP:52548

52548 is the port my internet router change when doing NAT (5060->52548). I
found this port sniffing traffic

Conclusions at this point are:

-1--
If I use this line:

listen=udp:SOURCE-IP:5060 advertise PUBLIC-IP:5060 it does not work :(

When I dial a call, INVITE / ACK / Trying / OK goes fine because they are
part of the same transaction
When remote party disconnects the call, BYE goes to PUBLIC-IP port 5060 and
router blocks de request. I assume vendor sends BYE to 5060 because it is a
new transaction

---2--

If I use this line:

listen=udp:SOURCE-IP:5060 advertise PUBLIC-IP:52548 it work !!

When I dial a call, INVITE / ACK / Trying / OK goes fine because they are
part of the same transaction
When remote party disconnects the call, BYE goes to PUBLIC-IP port 52548
and router forward the request to Kamailio. Since there is an open
connection.

I need to find the way to find the way to advertise the public port
internet router is doing NAT (PAT).

---
This trace is a call that worked fine because I included line:

listen=udp:SOURCE-IP:5060 advertise PUBLIC-IP:52548


This trace is an INVITE with this line: listen=udp:SOURCE-IP:5060 advertise
PUBLIC-IP:52548
2016/01/13 20:10:15.793568 PRIVATE-IP-KAMAILIO:5060 -> VENDOR-IP:5060
INVITE sip:NUM-DESTINATION@VENDOR-IP SIP/2.0
Record-Route: <
sip:PUBLIC-IP:52548;lr=on;ftag=as3b72a453;vsf=AAEECQkCAgsNAXBeL0NPXVQfU0suMTY5LjIzMQ--;vst=AABCUEIAX1lKWF5MF0tB
A-;nat=yes>
Via: SIP/2.0/UDP
PUBLIC-IP:52548;branch=z9hG4bKdd74.992e238037882e809653f713a5a580a9.0
Via: SIP/2.0/UDP
PRIVATE-IP-SOFTPHONE:5060;received=PRIVATE-IP-SOFTPHONE;branch=z9hG4bK2f4e76ba;rport=5060
Max-Forwards: 69
From: NUM-SOURCE <sip:NUM-SOURCE@PRIVATE-IP-KAMAILIO>;tag=as3b72a453
To: <sip:NUM-DESTINATION@sip.VENDOR-IP>
Contact: <sip:NUM-SOURCE@PRIVATE-IP-SOFTPHONE:5060;alias=PUBLIC-IP~5060~1>
Call-ID: 329950447629810f7bdeaeed0cc034e1@PRIVATE-IP-SOFTPHONE:5060
CSeq: 102 INVITE
User-Agent: Kamailio
Date: Wed, 13 Jan 2016 19:10:15 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 255


Trying.

2016/01/13 20:10:15.842055 VENDOR-IP:5060 -> PRIVATE-IP-KAMAILIO:5060
SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP
PUBLIC-IP:52548;branch=z9hG4bKdd74.992e238037882e809653f713a5a580a9.1;rport=52548
Via: SIP/2.0/UDP
PRIVATE-IP-SOFTPHONE:5060;received=PRIVATE-IP-SOFTPHONE;branch=z9hG4bK2f4e76ba;rport=5060
From: NUM-SOURCE <sip:NUM-SOURCE@PRIVATE-IP-KAMAILIO>;tag=as3b72a453
To: <sip:NUM-DESTINATION@VENDOR-IP>
Call-ID: 329950447629810f7bdeaeed0cc034e1@PRIVATE-IP-SOFTPHONE:5060
CSeq: 102 INVITE
Server: kamailio
Content-Length: 0




And finally a BYE

2016/01/13 20:10:28.545526 VENDOR-IP:5060 -> PRIVATE-IP-KAMAILIO:5060
BYE sip:34982298000@PRIVATE-IP-SOFTPHONE:5060;alias=PUBLIC-IP~5060~1 SIP/2.0
Via: SIP/2.0/UDP
VENDOR-IP;branch=z9hG4bK26d8.847e6e14eef37e2cfc8b5e81d33de73d.0
From: <sip:675896262@PRIVATE-IP-KAMAILIO>;tag=gK0293ed93
To: "NUM-SOURCE" <sip:NUM-SOURCE@ <sip%3anum-sou...@norvoz.es>VENDOR-IP
>;tag=as3b72a453
Call-ID: 329950447629810f7bdeaeed0cc034e1@PRIVATE-IP-SOFTPHONE:5060
CSeq: 28731 BYE
Max-Forwards: 69
Route: <
sip:PUBLIC-IP:52548;lr=on;ftag=as3b72a453;vsf=AAEECQkCAgsNAXBeL0NPXVQfU0suMTY5L

Re: [SR-Users] Kamailio and NAT

2016-01-13 Thread Nelson Migliaro
le:
>
> listen=udp:10.10.10.10:5060 advertise  11.11.11.11:5060
>
> For more info refer to 
> http://www.kamailio.org/wiki/cookbooks/3.3.x/core#listen
>
> Regards
>
> Gholamreza Sabery Tabrizy
>
>
>
> On Wed, Jan 13, 2016 at 2:39 AM, Daniel-Constantin Mierla <
> mico...@gmail.com> wrote:
>
>> Hello,
>>
>> can you get the SIP trace with all the packets of such dialog outside of
>> the NAT router? It will help to see the headers and based on that we may be
>> able to provide a solution.
>>
>> Cheers,
>> Daniel
>>
>>
>> On 12/01/16 19:13, Nelson Migliaro wrote:
>>
>> Thank you for your answer.
>>
>> The problem I have is with internet router doing to PAT to SIP port.
>> I am already advertising public IP but unfortunately I cant know the
>> public port I am using.
>>
>> 2015-12-28 18:17 GMT+01:00 Alexandru Covalschi <568...@gmail.com>:
>>
>>> AFAIK bye is usually sent to the address stored in record_route. Try
>>> setting changing record_route() to
>>> record_route_preset("PUBLICIP:5060;nat=yes:)
>>>
>>> 2015-12-23 16:28 GMT+02:00 Nelson Migliaro < <eng.migli...@gmail.com>
>>> eng.migli...@gmail.com>:
>>>
>>>>
>>>> Hello,
>>>>
>>>> I am running Kamailio behind NAT.
>>>>
>>>> Kanailio has a private IP and I am relaying NAT to internet router.
>>>>
>>>> I am using:
>>>>
>>>> - #!define WITH_NAT
>>>> - listen=udp:PRIVATE-IP:5060 advertise PUBLIC-IP:5060
>>>>
>>>> - Patched RTP proxy including the advertise option
>>>>
>>>> And everything goes fine. I can make calls and have two way audio.
>>>>
>>>> The problem begins when the callee ends the call. BYE is not received
>>>> in Kamailio (caller)
>>>>
>>>> I included the public IP using "add_contact_alias" because
>>>> "set_contact_alias" was not adding the public IP. I included this in in
>>>> NATDETECT (pre loaded router)
>>>>
>>>> if(is_first_hop()) {
>>>> xlog("L_NOTICE","Metodo: $rm \n");
>>>> xlog("L_NOTICE","is first hop\n");
>>>> #set_contact_alias();
>>>>  if (!add_contact_alias("PUBLIC-IP", "$Rp", "udp")) {
>>>>  xlog("L_ERR", "Error in aliasing contact $ct\n");
>>>> send_reply("400", "Bad request");
>>>> exit;
>>>> }
>>>> }
>>>>
>>>> I think the problem is related to destination that BYE is sent by the
>>>> vendor. From what I see IP and port is taken from advertised in contact
>>>> (PUBLIC-IP and 5060).
>>>> The problem is that internet router changes the source port.
>>>>
>>>> Contact: <sip:9@PRIVATE-IP:5060;alias=PUBLIC-IP~5060~1>
>>>>
>>>> --- Is it correcto to add_contact_alias("PUBLIC-IP", "$Rp", "udp") in
>>>> order to received new transactions or should I follow a different
>>>> procedure???
>>>>
>>>> Thank you
>>>>
>>>>
>>>>
>>>>
>>>> ___
>>>> 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
>>>
>>>
>>
>>
>> ___
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
>> listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>> --
>> Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - 
>> http://www.linkedin.com/in/miconda
>> Book: SIP Routing With Kamailio - http://www.asipto.comhttp://miconda.eu
>>
>>
>> ___
>> 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
>>
>>
>
> ___
> 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
>
>
___
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 and NAT

2016-01-12 Thread Nelson Migliaro
Thank you for your answer.

The problem I have is with internet router doing to PAT to SIP port.
I am already advertising public IP but unfortunately I cant know the public
port I am using.

2015-12-28 18:17 GMT+01:00 Alexandru Covalschi <568...@gmail.com>:

> AFAIK bye is usually sent to the address stored in record_route. Try
> setting changing record_route() to
> record_route_preset("PUBLICIP:5060;nat=yes:)
>
> 2015-12-23 16:28 GMT+02:00 Nelson Migliaro <eng.migli...@gmail.com>:
>
>>
>> Hello,
>>
>> I am running Kamailio behind NAT.
>>
>> Kanailio has a private IP and I am relaying NAT to internet router.
>>
>> I am using:
>>
>> - #!define WITH_NAT
>> - listen=udp:PRIVATE-IP:5060 advertise PUBLIC-IP:5060
>>
>> - Patched RTP proxy including the advertise option
>>
>> And everything goes fine. I can make calls and have two way audio.
>>
>> The problem begins when the callee ends the call. BYE is not received in
>> Kamailio (caller)
>>
>> I included the public IP using "add_contact_alias" because
>> "set_contact_alias" was not adding the public IP. I included this in in
>> NATDETECT (pre loaded router)
>>
>> if(is_first_hop()) {
>> xlog("L_NOTICE","Metodo: $rm \n");
>> xlog("L_NOTICE","is first hop\n");
>> #set_contact_alias();
>>  if (!add_contact_alias("PUBLIC-IP", "$Rp", "udp")) {
>>  xlog("L_ERR", "Error in aliasing contact $ct\n");
>> send_reply("400", "Bad request");
>> exit;
>> }
>> }
>>
>> I think the problem is related to destination that BYE is sent by the
>> vendor. From what I see IP and port is taken from advertised in contact
>> (PUBLIC-IP and 5060).
>> The problem is that internet router changes the source port.
>>
>> Contact: <sip:9@PRIVATE-IP:5060;alias=PUBLIC-IP~5060~1>
>>
>> --- Is it correcto to add_contact_alias("PUBLIC-IP", "$Rp", "udp") in
>> order to received new transactions or should I follow a different
>> procedure???
>>
>> Thank you
>>
>>
>>
>>
>> ___
>> 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
>
>
___
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] Kamailio and NAT

2015-12-23 Thread Nelson Migliaro
Hello,

I am running Kamailio behind NAT.

Kanailio has a private IP and I am relaying NAT to internet router.

I am using:

- #!define WITH_NAT
- listen=udp:PRIVATE-IP:5060 advertise PUBLIC-IP:5060

- Patched RTP proxy including the advertise option

And everything goes fine. I can make calls and have two way audio.

The problem begins when the callee ends the call. BYE is not received in
Kamailio (caller)

I included the public IP using "add_contact_alias" because
"set_contact_alias" was not adding the public IP. I included this in in
NATDETECT (pre loaded router)

if(is_first_hop()) {
xlog("L_NOTICE","Metodo: $rm \n");
xlog("L_NOTICE","is first hop\n");
#set_contact_alias();
 if (!add_contact_alias("PUBLIC-IP", "$Rp", "udp")) {
 xlog("L_ERR", "Error in aliasing contact $ct\n");
send_reply("400", "Bad request");
exit;
}
}

I think the problem is related to destination that BYE is sent by the
vendor. From what I see IP and port is taken from advertised in contact
(PUBLIC-IP and 5060).
The problem is that internet router changes the source port.

Contact: 

--- Is it correcto to add_contact_alias("PUBLIC-IP", "$Rp", "udp") in order
to received new transactions or should I follow a different procedure???

Thank you
___
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] Carrierroute and dispatcher

2015-07-28 Thread Nelson Migliaro
Hello everybody,

I am currently using Kamailio in order to separate traffic based on dialed
number.

Some traffic goes to several Asterisk in a load balance strategy and other
traffic goes to other SIP devices.

I use carrierroute module in order to route traffic based on destination. I
use scan_prefix to classify traffic and rewrite_host to route the traffic.

A destination number usually go to one of 4 asterisk server. I do this in
order to load balance the traffic. In order to distribute traffic I use
prob (0.25 for each destination).

Using this configuration, I have to include on carrieroute table a row for
each destination node. Since the amount of destination is huge, I have to
repeat configuration in tables. It also complicates maintenance.

I was thinking of using a combination of carrierroute and dispatcher
module. Carrierroute for classify traffic, strip numbers, and rewrite
destination host and dispatcher to distribute the traffic over asterisk.
Using this configuration I have to indicate asterisk nodes once in
dispatcher table once. Also in carrierroute table I have to indicate each
prefix once.

I was thinking in something like this.

if(!cr_route(carrier, domain, $rU, $rU, call_id)){
 sl_send_reply(403, Not allowed);
 drop;
}

if(!ds_select_dst(1, 4)) {
 sl_send_reply(403, Not allowed);
 drop;
}

t_relay;

Does it make sense, or am I complicating everything and there is a magic
way to achieve this.

Thank you.
___
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] (no subject)

2015-06-26 Thread Nelson Migliaro
Hello everybody,

My SIP vendor request me to replace FROM before sending the traffic. In
order to achieve this I use uac_replace_from.

UAC module is setup in restore_mode = auto.

In my insfrastructure I have an Asterisk and then a Kamailio that connects
to vendor via internet.

Softphone - Asterisk - Kamailio - Internet - SIP vendor

If caller ID is setup in Asterisk using CALLERID(num)=348 and then
INVITE is forwarded to Kamailio, the call is established and finished
correctly but the URI in TO field in BYE request from Kamailio to Asterisk
contains garbage. In the scenario the callee hangs up the call.

Example of TO Field with garbage: 348 sip:50026896@no{soy,ns^^

What I do see is that the number 50026896 that is part of the URI is the
same I use in:
uac_replace_from(50026896, sip:50026...@sip.vendor.es);

Something else that I have found is that vsf field is the same in the
INVITE and in the BYE.


2015/06/23 17:48:38.552442 192.168.0.2:5060 - 192.168.0.1:5060
BYE sip:348@192.168.0.1:5060 SIP/2.0
Via: SIP/2.0/UDP
192.168.0.2;branch=z9hG4bKfb49.73c6517609cdb6f7ec00b1f40a05dbe9.0
Via: SIP/2.0/UDP
8.8.8.8.8;rport=5060;branch=z9hG4bKfcdf.3767c59c2d0e3d8ab695669845ce4cea.0
branch=z9hG4bK04boo6104o5hcso0c2a1sdg00.1
Call-ID: 4bf8effb45b0ae8e049366297924cbba@192.168.0.1:5060
From: sip:289@192.168.0.2;tag=k0eci3x3-CC-30
To: 348 sip:50026896@no{soy,ns^^;tag=as041b7d84
CSeq: 1 BYE
Reason: Q.850;cause=16;text=normal call clearing
Max-Forwards: 67
Content-Length: 0

--
DEBUG: uac [replace.c:525]: restore_uri(): getting 'vsf' Route param
DEBUG: uac [replace.c:533]: restore_uri(): route param is
'AAEECQkCAgsNAXBeL0NGQUsfVl02Ni44Mw--' (len=40)
DEBUG: uac [replace.c:607]: restore_uri(): decoded uris are:
new=[sip:50026896@no{soy,ns#005#007] old=[sip:348@8.8.8.8]
DEBUG: uac [replace.c:525]: restore_uri(): getting 'vst' Route param
DEBUG: uac [replace.c:533]: restore_uri(): route param is
'AAQPAw8MDgsAAHZBKRVdAhoVHQ4XH1BdYWJhbnRlLmVz' (len=48)
DEBUG: uac [replace.c:607]: restore_uri(): decoded uris are: new=[
sip:289@192.168.0.1] old=[sip:99...@sip.vendor.es]
---
___
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] How to make OutBound calls with kamailio

2015-06-19 Thread Nelson Migliaro
I would also recommend you to use   xlog(L_INFO,  \n); in order to
understand the logic of the kamailio.cfg


2015-06-17 15:19 GMT+02:00 Daniel-Constantin Mierla mico...@gmail.com:

 Hello,

 On 17/06/15 12:36, sharad tyagi wrote:
  Hi
 
  I am novice to kamailio , I have installed kamailio-4.2.0 and SIREMIS.
  I have add and registered two IP phones with kamailio these phone able
  to call each other.
 
  How can i make outbound call with that I am using a asterisk server as
  PSTN Gateway. i am not famalier with kamailio script.

 the basic setup for a pstn gateway is in default kamailio.cfg. Read the
 remarks in the comments at the top of default kamailio.cfg for some
 guidelines on what to do.

 Cheers,
 Daniel

 --
 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

___
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] SIP Ping a device using Kamailio

2015-06-18 Thread Nelson Migliaro
Hello,

Is there a way to ping a device using Kamailio.

In my scenario I need to access a Kamailio located in my DMZ over a
firewall that is only open in LAN  DMZ direction. It is close in the other
way round.

In my current configuration I keep the link open using Asterisk qualify
option in SIP. I would like to replace Astersik located in LAN with
Kamailio thus I need to keep the link open.

I know there is an option using dispatch but I would like to avoid using
this module in order to keep it simple.

Is there a simple embedded function in order to accomplish this.

thank you
___
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] Select a network

2015-06-01 Thread Nelson Migliaro
if(src_ip=”192.168.2.5”)

But I would like no include the whole network.

Thank you

2015-06-01 9:43 GMT+02:00 Nelson Migliaro eng.migli...@gmail.com:

 Hello everybody,

 I need to apply a specific configuration to softphones registering from a
 specific network range.

 Is there something like:


___
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] Select a network

2015-06-01 Thread Nelson Migliaro
Hello everybody,

I need to apply a specific configuration to softphones registering from a
specific network range.

Is there something like:
___
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] Forward register to multiple Asterisk

2015-05-29 Thread Nelson Migliaro
Hello,

I am trying to forward the register to multiple Asterisk using Kamailio.

The basic Idea is:

Softphone AKamailio- Asterisk 1
-- Asterisk 2.

I follow Asipto howto http://lylix.net/kamailio, but the problem I see in
my case, is that registration IP in Asterisk is Kamailio´s IP. This causes
calls going from kamailio to asterisk and then back to kamailio. In my
scenario, I need that softphone A IP appeard in Asterisk realtime contact
IP.

The call path would be:

Softphone B - kamailio - Asterisk 1 or Asterisk 2 (depending on
dispatcher) - Softphone A

Following Asipto how to the call goes Softphone A - kamailio - asterisk
- kamailio Softphone B

Hope I explain myself clearly.

Thank you in advance.
___
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] Carrierroute question

2015-04-14 Thread Nelson Migliaro
Hello everyone,

I have a SIP provider that gives me access to different routes over the
same IP address but different prefixes.

I have to send all calls to the same IP but I need to inlcude a prefix to
allow vendor to route calls to different carriers.

I will use carrierroute (cr) module and in case prefix 1 fails, I should
send the call to prefix 2 and so on.

The problem I have is cr module detects that this host (public vendor ip)
was already used and I am getting this warning:

NOTICE: carrierroute [cr_func.c:324]: cr_uri_already_used(): Candidate
destination

This machine use public DNS and I tried to set up 3 entries in /etc/hosts

public_iP vendor_1
public_iP vendor_2
public_iP vendor_3

and instead of using the IP in rewrite_host I changed to the name:
vendor_1, vendor_2. vendor_3
but I got error:  ERROR: tm [ut.h:337]: uri2dst2(): failed to resolve
vendor_1

Is there a better war to resolve this

Thank you in advance
___
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] Carrierroute question

2015-04-14 Thread Nelson Migliaro
Thank you for the quick answer.

I will create 3 A register in my public dns provider over internet and all
of them will resolve the same IP.
If I apply the patch I will loose the dont not send call to same gateway
option.

Again, thank you for the quick response.

Regards,

Nelson.-





2015-04-14 14:51 GMT+02:00 Pawel Kuzak pawel.ku...@1und1.de:

  Hallo Nelson,

 What Kamailio version do you use?
 We have implemented this feature to carrierroute because we didn't want
 carrierroute to send a request to an already tried host again.
 Considering your use case, we could extend the module with an additional
 parameter to offer the option to deactivate this future. We could provide
 the patch this week (probably tomorrow). Would this be O.K. for you?

 Greetings,
 Paul


 On 14.04.2015 14:09, Nelson Migliaro wrote:

  Hello everyone,

  I have a SIP provider that gives me access to different routes over the
 same IP address but different prefixes.

  I have to send all calls to the same IP but I need to inlcude a prefix to
 allow vendor to route calls to different carriers.

  I will use carrierroute (cr) module and in case prefix 1 fails, I should
 send the call to prefix 2 and so on.

 The problem I have is cr module detects that this host (public vendor ip)
 was already used and I am getting this warning:

 NOTICE: carrierroute [cr_func.c:324]: cr_uri_already_used(): Candidate
 destination

  This machine use public DNS and I tried to set up 3 entries in /etc/hosts

 public_iP vendor_1
 public_iP vendor_2
 public_iP vendor_3

  and instead of using the IP in rewrite_host I changed to the name:
 vendor_1, vendor_2. vendor_3
  but I got error:  ERROR: tm [ut.h:337]: uri2dst2(): failed to resolve
 vendor_1

  Is there a better war to resolve this

  Thank you in advance








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



 ___
 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


___
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