[SR-Users] Presence data to users behind NAT

2015-03-22 Thread Olli Attila

Hello,

Im running kamailio 4.2.3 and I'm trying to build a system where I could 
have the following features: SIP proxy, RTP proxy, Presence  XCAP 
service for IM messaging.


I have a problem with the Presence service with users that are located 
behind nat. When Kamailio sends presence info to a watcher with sip 
NOTIFY message, the destaination ip for the pacage seems to be an 
un-routable (=private) ip, and so the watcher never receives the NOTIFY 
message making the watchers sip client unaware of the other users presence.


Any suggestions how to make Kamailio handle the watchers behind nat so 
that the NOTIFY messages will get delivered succesfully?


I tried the scenario with a client with public ip and the presence works 
fine.


my kamailio.cfg:
http://tny.cz/7d85773c

-- Olli

___
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 with websocket as transport

2015-03-22 Thread Austin Einter
Thanks Daniel.

Is there any example kamailio.cfg file with websocket enabled.
I downloaded one from https://gist.github.com/jesusprubio/4066845/download#
, it shows around 74 config errors.

Thanks
Austin

On Fri, Mar 20, 2015 at 1:27 PM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

 Hello,


 On 20/03/15 01:48, Austin Einter wrote:
  Dear All
  I have a sip user agent. Today it works fine with Kamailio using tcp
  as tranasport. Now I am planning to support websocket in my sip ua.
 
  My question is does Kamailio support websocket transport. If so how
  can I configure it or while building kamailio do I need to make some
  flags on. I am using latest Kamailio 4.2.3 (version: kamailio 4.2.3
  (x86_64/linux)).
 kamailio supports websocket since version 4.0. Look at the readme for
 websocket module to get started with it:

   - http://kamailio.org/docs/modules/stable/modules/websocket.html

 If you need to decrypt/encrypt SRTP, then see rtpengine module and
 rtpengine application.

 Cheers,
 Daniel

 --
 Daniel-Constantin Mierla
 http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
 Kamailio World Conference, May 27-29, 2015
 Berlin, Germany - http://www.kamailioworld.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] remove_hf_value

2015-03-22 Thread Slava Bendersky
Hello Daniel, 
I end up insert routes like this. And right now on client side I see only 
public ip route and private side only private ip routes. 

route[ROUTE_HDR_ORG] { 
# Getting record routes 
if(is_present_hf(Route)) { 
xlog(L_INFO, [$rm], Inbound connection from $si\n); 
if(is_method(NOTIFY)) { 
if(is_ip_rfc1918($si)) { 
xlog(L_INFO, [$rm], Present Route: $(route_uri{uri.host})\n); 
remove_hf(Route); 
insert_hf(Record-Route: sip + $sel(cfg_get.kamailio.bindpublicip) + : 
$sel(cfg_get.kamailio.bindpublicport);transport=tcp;lr=on;ftag=$ft;nat=yes\r\n);
 
$fs = tcp + : + $sel(cfg_get.kamailio.bindpublicip) + : + 
$sel(cfg_get.kamailio.bindpublicport); 
} else { 
xlog(L_INFO, [$rm], Present Route: $(route_uri{uri.host})\n); 
remove_hf(Route); 
insert_hf(Record-Route: sip + : $sel(cfg_get.kamailio.bindip) + : + 
$sel(cfg_get.kamailio.bindport);lr=on;ftag=$ft;nat=yes\r\n); 
$fs = udp + : + $sel(cfg_get.kamailio.bindip) + : + 
$sel(cfg_get.kamailio.bindport); 
} 
} 
} 
} 

And for initial SUBSCRIBE INVITE 

if (is_method(INVITE|SUBSCRIBE)) { 
remove_hf(Route); 
insert_hf(Record-Route: sip + : + $sel(cfg_get.kamailio.bindip) + : + 
$sel(cfg_get.kamailio.bindport);lr=on;ftag=$ft;nat=yes\r\n); 
#record_route(); 
} 


Slava. 


From: Daniel-Constantin Mierla mico...@gmail.com 
To: Slava Bendersky volga...@networklab.ca, sr-users 
sr-users@lists.sip-router.org 
Sent: Wednesday, March 18, 2015 4:15:28 AM 
Subject: Re: [SR-Users] remove_hf_value 

Hello, 

but the INVITE request goes out with 2 Record Route headers, if you get them in 
the 200ok. 

Not sure how it is going to work overall, you will have to manually set local 
sockets for requests within dialog, because you are doing also trasport layer 
gatewaying (tcp-udp). 

Anyhow, as a solution, maybe you should just not be using record_route() 
function and just add the header with insert_hf() for the invite, remove the 
Record-Route header for 200ok with remove_hf() and insert a new one again with 
insert_hf() 

If you know the local address (IP/port/transport) you want to put in the 
Record-Route, you can build the header as: 

insert_hf(Record-Route: 
sip:_LOCAL_IP_:_LOCAL_PORT_;transport=_LOCAL_TRANSPORT_;lr=on;ftag=$ft;nat=yes
 \r\n); 

Requests within the dialog can be handled with loose_route(), but again, you 
have to do more in config for selecting the local socket to send to next hop. 

Cheers, 
Daniel 

On 16/03/15 13:35, Slava Bendersky wrote: 



Hello Daniel, 
I want do clean up on routes from first SUBSCRIBE, that when traffic goes to 
public side of kamailio will be only public route and when traffic is internal 
the Record-Route will stay internal only. In SDP I see like this. 
I tired double routes set 0 in rr, but didn't clean enough. 

--- Transmitting (NAT) to 10.18.130.46:5060 --- 
SIP/2.0 200 OK 
Via: SIP/2.0/UDP 
10.18.130.46;branch=z9hG4bKf852.e0223f39c2bbad8366fdf1b7cb22b336.0;i=8;received=10.18.130.46;rport=5060
 
Via: SIP/2.0/TCP 
192.168.88.252:5062;received=client_pub_ipbranch=z9hG4bK0bbe1f7d27257bba9;rport=5062
 
Record-Route: sip:10.18.130.46;r2=on;lr=on;ftag=a185d974ec;nat=yes On public 
side remote this Record-Route 
Record-Route: 
sip:kamailio_pub_ip:5084;transport=tcp;r2=on;lr=on;ftag=a185d974ec;nat=yes On 
private side remote this Record-Route 
From: Slava Bendersky sips:10...@networklab.ca ;tag=a185d974ec 
To: sips:10...@networklab.ca ;tag=as00757d3e 
Call-ID: b08adb1ad1804a83 
CSeq: 236711034 SUBSCRIBE 
Server: FPBX-2.11.0(11.15.1) 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH, MESSAGE 
Supported: replaces, timer 
Expires: 3600 
Contact: sip:10101@10.18.130.50:5060 ;expires=3600 
Content-Length: 0 


Slava. 


From: Daniel-Constantin Mierla mico...@gmail.com 
To: sr-users sr-users@lists.sip-router.org 
Sent: Monday, March 16, 2015 7:01:54 AM 
Subject: Re: [SR-Users] remove_hf_value 

Hello, 

can you give an example of incoming header and how you want to be after 
modification? 

It is not clear for me what end result you want/expect. 

Cheers, 
Daniel 

On 14/03/15 06:41, Slava Bendersky wrote: 

BQ_BEGIN

Hello Everyone, 
Here updated version. Trying remove Record-Route after the coma. 
My log shows 

Mar 14 01:25:21 canlvprx01 /usr/sbin/kamailio[751]: INFO: script: 
[SUBSCRIBE], Inbound connection from Client Public IP 
Mar 14 01:25:21 canlvprx01 /usr/sbin/kamailio[751]: ERROR: script: null 
Mar 14 01:25:21 canlvprx01 /usr/sbin/kamailio[751]: INFO: script: 
[SUBSCRIBE], Route for removal: 'null' 

route snippet. 

route[ROUTE_HDR_ORG] { 
# Getting record routes 
if(is_present_hf(Route)) { 
xlog(L_INFO, [$rm], Inbound connection from $si\n); 
if(is_method(SUBSCRIBE)) { 
if(is_ip_rfc1918($si)) { 
xlog( $sel(@hf_value.Record_Route[-1]) ); 
xlog(L_INFO, [$rm], Route for removal: 
'$sel(@hf_value.Record_Route[-1])'\n); 
remove_hf_value(Record-Route[-1]); 
} else { 
xlog( $sel(@hf_value.Record_Route[1]) ); 
xlog(L_INFO, [$rm], Route for removal: 
'$sel(@hf_value.Record_Route[1])'\n); 

Re: [SR-Users] kamailio asterisk NOTIFY

2015-03-22 Thread Slava Bendersky
Hello Daniel, 
I still can't understand clearly why when asterisk send NOTIFY to client 
through kamailio it coming back with with 408. I 
I tried different case event change Contact:, but no luck can't I see what the 
issue all routes in first SUBSCRIBE looks ok . 
Any though or help will be really appreciate. 

This what I see on asterisk debug 

Reliably Transmitting (NAT) to 10.18.130.46:5060: 
NOTIFY sip:102@192.168.88.243:5068;alias=client_pub_ip~5068~2 SIP/2.0 
Via: SIP/2.0/UDP 10.18.130.51:5060;branch=z9hG4bK5dd3f266 
Max-Forwards: 70 
Route: sip:10.18.130.46:5060;lr=on;ftag=3b27a2a409;nat=yes ---Kamailio route 
From: canlpbx02 sip:canlpbx02@10.18.130.51;tag=as56402f92 
To: sip:102@192.168.88.243:5068;alias=client_pub_ip~5068~2;tag=3b27a2a409 
Contact: sip:canlpbx02@10.18.130.51:5060 
Call-ID: b1edde040d695988 
CSeq: 102 NOTIFY 
User-Agent: FPBX-12.0.43(12.8.1) 
Event: message-summary 
Content-Type: application/simple-message-summary 
Subscription-State: active 
Content-Length: 88 

Messages-Waiting: yes 
Message-Account: sip:*97@10.18.130.51 
Voice-Message: 5/0 (0/0) 

--- 

--- SIP read from UDP:10.18.130.46:5060 --- 
SIP/2.0 200 OK 
Via: SIP/2.0/UDP 10.18.130.51:5060;rport=5060;branch=z9hG4bK5dd3f266 
From: canlpbx02 sip:canlpbx02@10.18.130.51;tag=as56402f92 
To: sip:102@192.168.88.243:5068;alias=client_pub_ip~5068~2;tag=3b27a2a409 
Call-ID: b1edde040d695988 
CSeq: 102 NOTIFY 
Allow: ACK, BYE, CANCEL, INVITE, MESSAGE, NOTIFY, OPTIONS, REFER, SUBSCRIBE, 
UPDATE 
Server: Media5-fone/4.1.6.3283 Android/5.1 
Supported: eventlist, replaces, timer 
Content-Length: 0 

- 
--- (10 headers 0 lines) --- 

--- SIP read from UDP:10.18.130.46:5060 --- 
SIP/2.0 408 Request Timeout 
Via: SIP/2.0/UDP 10.18.130.51:5060;branch=z9hG4bK6386387f;rport=5060 
From: canlpbx02 sip:canlpbx02@10.18.130.51;tag=as00936a6d 
To: sip:102@192.168.88.243:5066;alias=client_pub_ip~5066~2;tag=a3aea18741 
Call-ID: 5a66b87a618d1042 
CSeq: 103 NOTIFY 
Server: kamailio (4.2.3 (x86_64/linux)) 
Content-Length: 0 

- 


Slava. 


From: Daniel-Constantin Mierla mico...@gmail.com 
To: Slava Bendersky volga...@networklab.ca, sr-users 
sr-users@lists.sip-router.org 
Sent: Friday, March 13, 2015 1:28:33 PM 
Subject: Re: [SR-Users] kamailio asterisk NOTIFY 

Hello, 

that function might be in textopsx module. 

Cheers, 
Daniel 

On 13/03/15 14:25, Slava Bendersky wrote: 



Hello Daniel, 
Where possible find updated version of options for textops. 

[sr_module.c:701]: find_mod_export_record(): find_export_record: 
remove_hf_value not found 

Specially Record-Route manipulation. 

Slava. 


From: Slava Bendersky volga...@networklab.ca 
To: mico...@gmail.com 
Cc: sr-users sr-users@lists.sip-router.org 
Sent: Friday, March 13, 2015 8:54:26 AM 
Subject: Re: [SR-Users] kamailio asterisk NOTIFY 

Hello Daniel, 
Here paste for first SUBSCRIBE. 

http://fpaste.org/197545/25118514/ 

Slava. 


From: Daniel-Constantin Mierla mico...@gmail.com 
To: Slava Bendersky volga...@networklab.ca 
Cc: sr-users sr-users@lists.sip-router.org 
Sent: Thursday, March 12, 2015 5:09:17 AM 
Subject: Re: [SR-Users] kamailio asterisk NOTIFY 

Hello, 

can you get the sip traffic from the network (from the first subscribe of this 
presence dialog)? It will help to see the Route set. 

Cheers, 
Daniel 

On 12/03/15 00:36, Slava Bendersky wrote: 

BQ_BEGIN

Hello Daniel, 
Here debug of the notify which failing. Look like transaction miss match 

http://fpaste.org/196896/61168591/ 

Slava. 



From: Daniel-Constantin Mierla mico...@gmail.com 
To: Slava Bendersky volga...@networklab.ca , sr-users 
sr-users@lists.sip-router.org 
Sent: Wednesday, March 11, 2015 5:44:05 PM 
Subject: Re: [SR-Users] kamailio asterisk NOTIFY 

Hello, 

it doesn't matter if there is a mix of transports. If the UA is mirroring the 
Record-Route headers in the response to the NOTIFY, it should work fine. 

Cheers, 
Daniel 

On 11/03/15 21:40, Slava Bendersky wrote: 

BQ_BEGIN

Hello Daniel, 
Is this matter that UDP and TCP transport in mix ? 

Slava. 



From: Slava Bendersky volga...@networklab.ca 
To: mico...@gmail.com 
Cc: sr-users sr-users@lists.sip-router.org 
Sent: Wednesday, March 11, 2015 4:21:39 PM 
Subject: Re: [SR-Users] kamailio asterisk NOTIFY 

Hello Daniel, 
I have record route in WITHINDLG for NOTIFY, but it not helped behaviour is the 
same it loosing route for NOTIFY. 


Slava. 


From: Daniel-Constantin Mierla mico...@gmail.com 
To: Slava Bendersky volga...@networklab.ca , sr-users 
sr-users@lists.sip-router.org 
Sent: Wednesday, March 11, 2015 2:14:02 PM 
Subject: Re: [SR-Users] kamailio asterisk NOTIFY 

Hello, 

you have to do record_route() for all NOTIFY requests -- there are new specs 
requiring that (RFC 6665) and perhaps asterisk is following them. 

If you look in the default kamailio.cfg for v4.2, inside route[WITHINDLG], then 
you will see how it is done. 

Cheers, 
Daniel 

On 11/03/15 14:22, Slava Bendersky wrote: 

BQ_BEGIN

Hello Daniel, 
Here 

[SR-Users] Websocket kamailio.cfg doubt

2015-03-22 Thread Austin Einter
The README of websocket suggests to modify kamailio.cfg as below

















*# Handle requests within SIP dialogsroute[WITHINDLG] {if
(has_totag()) {# sequential request withing a dialog
should# take the path determined by
record-routingif (loose_route()) {
if ($du == ) {if (!handle_ruri_alias())
{xlog(L_ERR, Bad alias
$ru\n);sl_send_reply(400, Bad
Request);
exit;}
}route(RELAY);} else
{if ( is_method(ACK) ) {...*

But the original script was














































*# Handle requests within SIP dialogsroute[WITHINDLG] {if
(!has_totag()) return;# sequential request withing a dialog
should# take the path determined by record-routingif
(loose_route()) {route(DLGURI);if
(is_method(BYE)) {setflag(FLT_ACC); # do
accounting ...setflag(FLT_ACCFAILED); # ... even if
the transaction fails}else if (
is_method(ACK) ) {# ACK is forwarded
statelessyroute(NATMANAGE);
}else if ( is_method(NOTIFY) ) {#
Add Record-Route for in-dialog NOTIFY as per RFC
6665.record_route();
}route(RELAY);exit;}if
(is_method(SUBSCRIBE)  uri == myself) {# in-dialog
subscribe requestsroute(PRESENCE);
exit;}if ( is_method(ACK) ) {if (
t_check_trans() ) {# no loose-route, but stateful
ACK;# must be an ACK after a
487# or e.g. 404 from upstream
serverroute(RELAY);
exit;} else {# ACK without matching
transaction ... ignore and discard
exit;}}sl_send_reply(404,Not
here);exit;}*
Now I have to include the websocket README suggested script in original
script. I am not finding logical way where shall I include websocket part.

Can somebody please help me.

Thanks
Austin
___
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] Siremis error Call to a member function getQuoted()

2015-03-22 Thread canuck15

I think I found the root cause.

Siremis database has a table called group.  That is a reserved word in 
mysql that cannot be used as a table name.

http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html

Do the following to prove it.
mysql
 USE siremis;
 SELECT * FROM group;

error

 RENAME TABLE group TO group1;
 SELECT * FROM group1;

no error

On 3/21/2015 4:39 PM, canuck15 wrote:

When you add/update/view Administrator usernames

To reproduce
Administration  User Management 

Click on any existing username.  The browser goes blank.

Error in apache logs is:
PHP Fatal error: Call to a member function getQuoted() on a non-object 
in /var/www/html/openbiz/bin/data/BizDataSql.php on line 237

This is on the latest Siremis v4.2.0 downloaded today

I am using CentOS v6.6, php v5.3.3



___
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