Re: [SR-Users] question bout UA and BOX in same NAT

2011-09-07 Thread MingHon
Hi,

Sorry, let me explain my situation.

my box is behind nat with private ip 192.168.2.3 and nat ip is 60.x.x.x

and asterisk is same nat as the box with private ip 192.168.2.23

now let say i got 2 UA. one UA is located on different nat and another UA is
same nat with the box.

UA1- private ip 10.10.10.123 and nat ip is 60.y.y.y
UA2- private ip 192.168.2.100 and nat ip is 60.x.x.x

with advertised_address = 60.x.x.x
UA1 successfully register.
UA2 registration fail. because when box send option method, UA2 reply 200OK
to 60.x.x.x

is there anyway to rewrite the via header when sending to UA2 ?

Thanks and Regards,

MingHon

On Wed, Sep 7, 2011 at 4:40 PM, Daniel-Constantin Mierla
wrote:

>  Hello,
>
>
> On 9/6/11 8:53 AM, MingHon wrote:
>
> Hello List,
>
>  Can i have UA in the same nat with the box and also UA in different nat
> at the same time?
>
>  My box is currrently working behind nat with ip 192.168.2.3
> and advertised_address is set to sip.mydomain.com
>
>  is it possible to append the via header replace the sip.mydomain.com to
> 192.168.2.3 ?
>
> not sure I understand what you want to achieve. First you say that you want
> advertised address to be sip.mydomain.com but then you want it to be
> 192.168.2.3, which would be if you don't set advertised address parameter.
>
> Cheers,
> Daniel
>
> --
> Daniel-Constantin Mierla -- http://www.asipto.com
> Kamailio Advanced Training, Oct 10-13, Berlin: 
> http://asipto.com/u/kathttp://linkedin.com/in/miconda -- 
> http://twitter.com/miconda
>
>
___
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] Does xcap server of kamailio support partial update of xcap document?

2011-09-07 Thread Daniel-Constantin Mierla

Hello,

inserting a new node seems not to be possible through xpath operations 
only, so I made a patch to be able to add new nodes (entries) -- see it 
attached -- it is for devel version (master branch), hopefully it 
applies clean to 3.1 if you are using that version.


There was no option to test it at all, I just made sure it compiles. Let 
me know the results, if it runs but fails, send me the output with 
debug=4. If all is ok, I will commit to git repository.


Cheers,
Daniel

On 9/7/11 3:21 PM, laura testi wrote:

Hi,
we have patch the xcap_misc.h with "#define XCAP_MAX_URI_SIZE  255"
which was 127, and extended the length of field doc_uri in the xcap
table to 256 from 128. Now the errror is gone.

After that we have done some test with curl, following are the results:
- DELETE an Entry from the list: OK
   i.e.: curl  -X DELETE
http://:5060/xcap-root/resource-lists/users/sip:user@domain/index/~~/resource-lists/list/entry%5b@uri=%22sip:u1@d1%22%5d
  after this command, the contact u1@d1 is removed from the contact list.

- UPDATE an Entry from the list: OK
  i.e.,
curl -T entry.xml -X PUT
http://:5060/xcap-root/resource-lists/users/sip:user@domain/index/~~/resource-lists/list%5b@name=%22RootGroup%22%5d/entry%5b@uri=%22sip:u2@d2%22%5d

if the sip:u2@d2 entry exists, the entry is replaced with the entry in
the entry.xml (u3), which is
sip:u3@d3

if the sip:u2@d2 entry is not exists, the entry of u3@d3 is not added
to the list!!! follow the rfc4825, it should be added to the list if
the entry does not exits.

- Add an Entry from the list: KO
  i.e.,
curl -T entry.xml -X PUT
http://:5060/xcap-root/resource-lists/users/sip:user@domain/index/~~/resource-lists/list%5b@name=%22RootGroup%22%5d/entry%5b@uri=%22sip:u2@d2%22%5d

  the entry.xml is (u2)

  the entry sip:u2@d2 was not in the list before the command and is not
added after the command.

I think it's a bug of xcap server.


Many thanks!

Laura




On Wed, Sep 7, 2011 at 12:17 PM, Juha Heinanen  wrote:

Daniel-Constantin Mierla writes:


Feel free to do it, however I think it has to be reviewed where is used,
though -- it should be safe even size in db is longer as long as the
insert is done by kamailio itself, not sure we have affected cases when
the insert is done by external apps, so better double check...

every module that reads data from db should check size of received
string so that it is not longer than space reserved for it in data
structures. i hope that no module assumes that received data cannot be
bigger than what db schema says.

-- juha


___
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


--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda

diff --git a/modules_k/xcap_server/xcap_misc.c 
b/modules_k/xcap_server/xcap_misc.c
index 57abf3f..89ae3a1 100644
--- a/modules_k/xcap_server/xcap_misc.c
+++ b/modules_k/xcap_server/xcap_misc.c
@@ -433,13 +433,18 @@ int xcaps_xpath_set(str *inbuf, str *xpaths, str *val, 
str *outbuf)
xmlNodePtr parent = NULL;
int size;
int i;
+   char *p;
 
doc = xmlParseMemory(inbuf->s, inbuf->len);
if(doc == NULL)
return -1;
 
if(val!=NULL)
+   {
newnode = xmlParseMemory(val->s, val->len);
+   if(newnode==NULL)
+   goto error;
+   }
 
outbuf->s   = NULL;
outbuf->len = 0;
@@ -462,12 +467,53 @@ int xcaps_xpath_set(str *inbuf, str *xpaths, str *val, 
str *outbuf)
 nodes = xpathObj->nodesetval;
if(nodes==NULL)
{
+   /* no selection for xpath expression */
LM_DBG("no selection for xpath expression [%s]\n", xpaths->s);
-   goto done;
-   }
-   size = nodes->nodeNr;
-   if(val!=NULL)
-   value = (const xmlChar*)val->s;
+   if(val==NULL)
+   goto done;
+   /* could be an insert - locate the selection of parent node */
+   p = strrchr(xpaths->s, '/');
+   if(p==NULL)
+   goto done;
+   /* evaluate xpath expression for parrent node */
+   *p = 0;
+   xpathObj = xmlXPathEvalExpression(
+   (const xmlChar*)xpaths->s, xpathCtx);
+   if(xpathObj == NULL)
+   {
+   LM_DBG("unable to evaluate xpath parent expression 
[%s]\n",
+   xpaths->s);
+   *p = '/';
+   goto done;
+   }
+   *p = '/';
+   nodes = xpathObj->nodesetval;
+   if(nodes==NULL)
+   {
+   LM_DBG

Re: [SR-Users] Kamailio + rtpproxy talking to multiple carrier gateways - Solution

2011-09-07 Thread Sarat C. Vemuri
I think I have this working.  For anyone else trying to do similar thing (or 
placing Kamailio behind FW/NAT), here is my cookbook.

We are trying to setup the following:
[UAS] <--> 
(PubIP)[FireWall/One-to-OneNAT]<>(PrivIP)[Kamailio/RTPProxy](PrivIP)<-->(PrivIP2)[UAC]
UAC/UAS cannot reach each other directly.
For simplicity I am running RTPProxy on same machines as Kamailio.  But 
this can be changed.

Versions/Patches/fixes you need if you are running 3.1.2 : (Trunk/3.2 has 
these):
a. Fixed forward.c for mhome to work properly (included in 3.1.4).
b. rr module from trunk to be able to use 2 strings for 
record_route_preset
c. Patched rtpproxy module to actually use the forced ip supplied to 
force_rtp_proxy.  Patch at the end of this message
d. rtpproxy version 1.2.1

What to do:
1. Setup FW/NAT rules to map public IP to PrivateIP and allow 
communications to/from UAS
2. Setup RTPProxy in "bridged" mode (e.g -F -l 10.10.5.90/10.10.5.90 -s 
udp:10.10.5.90:9005) listening on PrivateIP.
3. Setup the config file to:
a. Setup modparams to make the above rtpproxy available. Use 
set_rtp_proxy_set if you have more than one instance.
b. Do the following where you are processing Outbound *initial* 
invite (i.e. check totag) (Call from UAC to UAS)
set_advertised_address("YourPublicIP ");
if(!has_totag()) { 
record_route_preset("YourPublicIP:5060;r2=on;nat=yes","YourPrivateIp:5060;r2=on;nat=yes");
 }
force_rtp_proxy("ocfaei"," YourPublicIP ");
c. Do the following where you are processing Inbound invite 
(Call from UAS to UAC)
if(!has_totag()) {  
record_route_preset("YourPrivateIP:5060;r2=on;nat=yes", 
"YourPublicIp:5060;r2=on;nat=yes"); }
force_rtp_proxy("ocfaei");
d. Do the following where you are processing replies 
(180/183/2XX)
For Inbound Calls
force_rtp_proxy("ocfa","YourPublicIP");
For Outbound Calls
force_rtp_proxy("ocfa");
e. Unforce RTPProxy on BYE or Failures.

Do not use  record_route in the above scenario.  If you have it now, remove it 
or make sure it doesn't get called for this specific case.

Explanation:
In #b, you are fixing the Via headers to use public IP, setting Record-Route 
headers so that ACK/RE-INVITE can find way back and are force fixing SDP with 
public IP for outbound calls.
In #c, You are doing same thing except no need to fix Via and the route set is 
reversed. No need to force fix SDP either since it is figured out 
automatically. 
In #d, You are force fixing the SDP to use the public IP for inbound or usual 
for outbound so that the audio stream from UAS can be relayed.
The r2=on parameter is required (as well as enabling double rr, which is 
default) so that the proxy can deal with the route sets properly

Hope the above helps others.

SV.

Rtpproxy Path
2226,2233c2226
<   LM_DBG("Str2 is %s\n", str2);
<   if(str2) {
<   newip.s = str2;
<   LM_DBG("NewIp is %s\n", newip.s);
<   }
<   else {
<   newip.s = (argc < 2) ? str2 : argv[1];
<   }
---
>   newip.s = (argc < 2) ? str2 : argv[1];  
> 





___
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] no publish from pua/pua_mi to outbound proxy

2011-09-07 Thread Daniel-Constantin Mierla

Hello,

On 8/30/11 7:43 AM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


In the xmlrpc command, there was an etag value, have you tried with '.'
as etag?

i haven't tried with "." etag yet.  i'll try that tomorrow.

mi pua publish from different UAs on same presentity seems to
work ok, when UAs always use "." as tag param.
based on a quick look over the code, allowing any etag should be 
possible by just removing the condition of an existing presentity when 
etag value is given and provide the etag to building PUBLISH headers. 
But is has to be tested, since I had no testbed setup for such case.


I am attaching the patch, would be great if you can test and report the 
results. Please check if a new record is inserted in the table when 200 
ok comes to such publish.


Thanks,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda

diff --git a/modules_k/pua/send_publish.c b/modules_k/pua/send_publish.c
index 3523cbc..4c9c07f 100644
--- a/modules_k/pua/send_publish.c
+++ b/modules_k/pua/send_publish.c
@@ -425,11 +425,13 @@ int send_publish( publ_info_t* publ )

presentity= search_htable(&pres, hash_code);
 
+#if 0
if(publ->etag && presentity== NULL)
{
lock_release(&HashT->p_records[hash_code].lock);
return 418;
}
+#endif
 
if(publ->flag & INSERT_TYPE)
{
@@ -537,8 +539,10 @@ send_publish:
 
if(publ->flag & UPDATE_TYPE)
LM_DBG("etag:%.*s\n", etag.len, etag.s);
-   str_hdr = publ_build_hdr((publ->expires< 0)?3600:publ->expires, ev, 
&publ->content_type, 
-   (publ->flag & UPDATE_TYPE)?&etag:NULL, 
publ->extra_headers, (body)?1:0);
+   str_hdr = publ_build_hdr((publ->expires< 0)?3600:publ->expires, ev,
+   &publ->content_type,
+   (publ->flag & UPDATE_TYPE)?&etag:publ->etag, 
publ->extra_headers,
+   (body)?1:0);
 
if(str_hdr == NULL)
{
___
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 + rtpproxy talking to multiple carrier gateways

2011-09-07 Thread Ovidiu Sas
It seems that you are on the right path now.

Regards,
Ovidiu Sas

On Wed, Sep 7, 2011 at 5:22 AM, Sarat C. Vemuri  wrote:
> Ovidiu,
>
> Thanks for your time.  The "fixes" I pulled in is the latest rr module only. 
> I didn't see anything in that diff to make this work.  Could you elaborate a 
> little?
>
> However, I was able to get "Outbound" working properly by adding ";r2=on" to  
> the record_route_preset IPs.  In going through the source code, I noticed 
> that this is what regular record_route uses to enable double rr and it would 
> automatically take both headers out if it sees that.  That seems to have 
> worked.  Any pitfals with this?
>
> I am still working on "Inbound".  For some reason my carrier GW keeps 
> resending invites even after receiving ACK.  I need to see if it is an issue 
> with the carrier.
>
> Thanks
> SV.
>
>
> -Original Message-
> From: Ovidiu Sas [mailto:o...@voipembedded.com]
> Sent: Tuesday, September 06, 2011 9:50 AM
> To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users 
> Mailing List
> Subject: Re: [SR-Users] Kamailio + rtpproxy talking to multiple carrier 
> gateways
>
> It seems that something is miss configured on your server.  The fixes that I 
> made in the trunk (and you pulled in your local 3.1 repo) were designed to 
> handle the scenario that you are trying to implement.
> The ACK should be handled properly and routed to the upstream carrier 
> (following the same path as the initial INVITE).
>
>
> Regards,
> Ovidiu Sas
>
> On Mon, Sep 5, 2011 at 5:07 PM, Sarat C. Vemuri  
> wrote:
>> Again, I apologize for this clumsy way of replying.
>>
>> Ovidiu,
>>
>> Thanks for the pointer on set_advertised_address.  I had to patch rtpproxy 
>> module (and rr module for the two parameters to request_route_preset) since 
>> I am running 3.1.
>>
>> However, I still have a problem with ACKs after following what you suggested.
>>
>> INVITE from Internal to Carrier routes properly (two Request-Route headers, 
>> one internal IP and other public IP).  On 200 OK, the carrier GW properly 
>> copies the route set in to Route header.  Now the route contains two 
>> entries, the public IP and the private IP of Kamailio.  The Internal UAC 
>> then sends the ACK back to Kamailio.  Everything is fine till this point.  
>> Now, Kamailio removes the top entry, which is the private IP and then 
>> promptly sends the ACK to the public IP of itself!.  Of course, that doesn't 
>> go anywhere.
>>
>> How do I remove the "public IP" entry from the route set before forwarding 
>> the reply to Internal UAC?  Is there another way to deal with this?  I've 
>> tried to set an alias= core parameter with the public IP, but doesn't seem 
>> to have any effect. The public IP is not reachable from internal network.
>>
>> Thanks for your help
>>
>> SV.
>> --
>>
>> Message: 3
>> Date: Sat, 3 Sep 2011 16:44:22 -0700
>> From: Ovidiu Sas 
>> Subject: Re: [SR-Users] Kamailio + rtpproxy talking to multiple
>>        carrier gateways - some via Firewall/NAT
>> To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
>>        Users   Mailing List" 
>> Message-ID:
>>
>> 
>> Content-Type: text/plain; charset=windows-1252
>>
>> It is feasable to what you want: kamailio behind NAT proxying traffic
>> from/to public internet to/from private network.
>> You will need to properly craft the INVITE and use proper record route 
>> headers.
>> Use set_advertised_address when needed:
>> http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#set_advertis
>> ed_address Also, use record_route_preset (note that there are two
>> parameters):
>> http://kamailio.org/docs/modules/devel/modules_k/rr.html#id2547566
>>
>> That should do it.  You don't need any patches for rtpproxy.
>> Just use force_rtpp_proxy (and force the IP address):
>> http://kamailio.org/docs/modules/devel/modules/rtpproxy.html#id2546034
>>
>>
>> Note: Make sure that you understand how in-dialog requests are routed
>> by a proxy in order to know how to properly handle the initial INVITE.
>>
>>
>> Regards,
>> Ovidiu Sas
>>
>> On Sat, Sep 3, 2011 at 2:53 PM, Sarat C. Vemuri  
>> wrote:
>>> We are trying to configure Kamailio ?(3.1.x) as a ?boarder proxy?
>>> where it acts as the front for various carrier gateways so that
>>> internal UACs and UASs are unaware of the carrier gateways.
>>>
>>>
>>>
>>> Let me try to present a clear picture of our setup.
>>>
>>> 1.?? Kamailio has several NICs (physical or vlan).? Each on a
>>> different subnet. One subnet is internal/has routes for internal.?
>>> Other subnets are private connections to carriers or a ?route to public 
>>> Internet.
>>>
>>> 2.?? All of these subnets are non-routable from Internet. In
>>> addition , the carrier private connections are not routable internally.
>>>
>>> 3.?? Connection to public internet is via a FW/NAT (one-to-one
>>> NAT), which maps to one of the interfaces.
>>>
>>> 4.?? All internal? UAC/UAS connect o

Re: [SR-Users] Does xcap server of kamailio support partial update of xcap document?

2011-09-07 Thread laura testi
Hi,
we have patch the xcap_misc.h with "#define XCAP_MAX_URI_SIZE   255"
which was 127, and extended the length of field doc_uri in the xcap
table to 256 from 128. Now the errror is gone.

After that we have done some test with curl, following are the results:
- DELETE an Entry from the list: OK
  i.e.: curl  -X DELETE
http://:5060/xcap-root/resource-lists/users/sip:user@domain/index/~~/resource-lists/list/entry%5b@uri=%22sip:u1@d1%22%5d
 after this command, the contact u1@d1 is removed from the contact list.

- UPDATE an Entry from the list: OK
 i.e.,
curl -T entry.xml -X PUT
http://:5060/xcap-root/resource-lists/users/sip:user@domain/index/~~/resource-lists/list%5b@name=%22RootGroup%22%5d/entry%5b@uri=%22sip:u2@d2%22%5d

if the sip:u2@d2 entry exists, the entry is replaced with the entry in
the entry.xml (u3), which is
sip:u3@d3

if the sip:u2@d2 entry is not exists, the entry of u3@d3 is not added
to the list!!! follow the rfc4825, it should be added to the list if
the entry does not exits.

- Add an Entry from the list: KO
 i.e.,
curl -T entry.xml -X PUT
http://:5060/xcap-root/resource-lists/users/sip:user@domain/index/~~/resource-lists/list%5b@name=%22RootGroup%22%5d/entry%5b@uri=%22sip:u2@d2%22%5d

 the entry.xml is (u2)

 the entry sip:u2@d2 was not in the list before the command and is not
added after the command.

I think it's a bug of xcap server.


Many thanks!

Laura




On Wed, Sep 7, 2011 at 12:17 PM, Juha Heinanen  wrote:
> Daniel-Constantin Mierla writes:
>
>> Feel free to do it, however I think it has to be reviewed where is used,
>> though -- it should be safe even size in db is longer as long as the
>> insert is done by kamailio itself, not sure we have affected cases when
>> the insert is done by external apps, so better double check...
>
> every module that reads data from db should check size of received
> string so that it is not longer than space reserved for it in data
> structures. i hope that no module assumes that received data cannot be
> bigger than what db schema says.
>
> -- juha
>

___
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 + rtpproxy talking to multiple carrier gateways

2011-09-07 Thread Sarat C. Vemuri
Ovidiu, 

Thanks for your time.  The "fixes" I pulled in is the latest rr module only. I 
didn't see anything in that diff to make this work.  Could you elaborate a 
little?

However, I was able to get "Outbound" working properly by adding ";r2=on" to  
the record_route_preset IPs.  In going through the source code, I noticed that 
this is what regular record_route uses to enable double rr and it would 
automatically take both headers out if it sees that.  That seems to have 
worked.  Any pitfals with this?

I am still working on "Inbound".  For some reason my carrier GW keeps resending 
invites even after receiving ACK.  I need to see if it is an issue with the 
carrier.

Thanks
SV.


-Original Message-
From: Ovidiu Sas [mailto:o...@voipembedded.com] 
Sent: Tuesday, September 06, 2011 9:50 AM
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users 
Mailing List
Subject: Re: [SR-Users] Kamailio + rtpproxy talking to multiple carrier gateways

It seems that something is miss configured on your server.  The fixes that I 
made in the trunk (and you pulled in your local 3.1 repo) were designed to 
handle the scenario that you are trying to implement.
The ACK should be handled properly and routed to the upstream carrier 
(following the same path as the initial INVITE).


Regards,
Ovidiu Sas

On Mon, Sep 5, 2011 at 5:07 PM, Sarat C. Vemuri  wrote:
> Again, I apologize for this clumsy way of replying.
>
> Ovidiu,
>
> Thanks for the pointer on set_advertised_address.  I had to patch rtpproxy 
> module (and rr module for the two parameters to request_route_preset) since I 
> am running 3.1.
>
> However, I still have a problem with ACKs after following what you suggested.
>
> INVITE from Internal to Carrier routes properly (two Request-Route headers, 
> one internal IP and other public IP).  On 200 OK, the carrier GW properly 
> copies the route set in to Route header.  Now the route contains two entries, 
> the public IP and the private IP of Kamailio.  The Internal UAC then sends 
> the ACK back to Kamailio.  Everything is fine till this point.  Now, Kamailio 
> removes the top entry, which is the private IP and then promptly sends the 
> ACK to the public IP of itself!.  Of course, that doesn't go anywhere.
>
> How do I remove the "public IP" entry from the route set before forwarding 
> the reply to Internal UAC?  Is there another way to deal with this?  I've 
> tried to set an alias= core parameter with the public IP, but doesn't seem to 
> have any effect. The public IP is not reachable from internal network.
>
> Thanks for your help
>
> SV.
> --
>
> Message: 3
> Date: Sat, 3 Sep 2011 16:44:22 -0700
> From: Ovidiu Sas 
> Subject: Re: [SR-Users] Kamailio + rtpproxy talking to multiple
>        carrier gateways - some via Firewall/NAT
> To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
>        Users   Mailing List" 
> Message-ID:
>        
> 
> Content-Type: text/plain; charset=windows-1252
>
> It is feasable to what you want: kamailio behind NAT proxying traffic 
> from/to public internet to/from private network.
> You will need to properly craft the INVITE and use proper record route 
> headers.
> Use set_advertised_address when needed:
> http://kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#set_advertis
> ed_address Also, use record_route_preset (note that there are two 
> parameters):
> http://kamailio.org/docs/modules/devel/modules_k/rr.html#id2547566
>
> That should do it.  You don't need any patches for rtpproxy.
> Just use force_rtpp_proxy (and force the IP address):
> http://kamailio.org/docs/modules/devel/modules/rtpproxy.html#id2546034
>
>
> Note: Make sure that you understand how in-dialog requests are routed 
> by a proxy in order to know how to properly handle the initial INVITE.
>
>
> Regards,
> Ovidiu Sas
>
> On Sat, Sep 3, 2011 at 2:53 PM, Sarat C. Vemuri  
> wrote:
>> We are trying to configure Kamailio ?(3.1.x) as a ?boarder proxy? 
>> where it acts as the front for various carrier gateways so that 
>> internal UACs and UASs are unaware of the carrier gateways.
>>
>>
>>
>> Let me try to present a clear picture of our setup.
>>
>> 1.?? Kamailio has several NICs (physical or vlan).? Each on a 
>> different subnet. One subnet is internal/has routes for internal.? 
>> Other subnets are private connections to carriers or a ?route to public 
>> Internet.
>>
>> 2.?? All of these subnets are non-routable from Internet. In 
>> addition , the carrier private connections are not routable internally.
>>
>> 3.?? Connection to public internet is via a FW/NAT (one-to-one 
>> NAT), which maps to one of the interfaces.
>>
>> 4.?? All internal? UAC/UAS connect on the internal subnet.
>>
>> 5.?? We are using RTPProxy? (at least one instance per carrier) 
>> to relay media between internal and carrier subnets
>>
>>
>>
>> We are able to make this setup up work great except for one 
>> scenario.? One of the carriers is o

Re: [SR-Users] Does xcap server of kamailio support partial update of xcap document?

2011-09-07 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

> Feel free to do it, however I think it has to be reviewed where is used, 
> though -- it should be safe even size in db is longer as long as the 
> insert is done by kamailio itself, not sure we have affected cases when 
> the insert is done by external apps, so better double check...

every module that reads data from db should check size of received
string so that it is not longer than space reserved for it in data
structures. i hope that no module assumes that received data cannot be
bigger than what db schema says.

-- juha

___
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] Does xcap server of kamailio support partial update of xcap document?

2011-09-07 Thread Daniel-Constantin Mierla

Hello,

On 9/7/11 11:26 AM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


the error is because the size of http url is higher than 127. You can
increase it, no problem, it is now 255 in devel version -- be aware you
have to increase in the database xcap table as well the size of
doc_uri.

daniel,

if uri size in devel version now is 255, should



in entities.xml be also changed?
indeed, probably we should make it uniform everywhere, even sip aor and 
usually shorter, in many cases there can be long uri parameters that 
over all can make it quite long.


Feel free to do it, however I think it has to be reviewed where is used, 
though -- it should be safe even size in db is longer as long as the 
insert is done by kamailio itself, not sure we have affected cases when 
the insert is done by external apps, so better double check...


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Does xcap server of kamailio support partial update of xcap document?

2011-09-07 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

> the error is because the size of http url is higher than 127. You can 
> increase it, no problem, it is now 255 in devel version -- be aware you 
> have to increase in the database xcap table as well the size of
> doc_uri.

daniel,

if uri size in devel version now is 255, should



in entities.xml be also changed?

-- juha

___
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] Does xcap server of kamailio support partial update of xcap document?

2011-09-07 Thread Daniel-Constantin Mierla

Hello,

On 9/7/11 11:24 AM, laura testi wrote:

Hi Daniel,
thank you for your quick reply. We have already tried with node
selector '~~' after doc uri in the http XCAP PUT request. But We got
the error "ERROR: xcap_server [xcap_misc.c:60]: http uri too long"
  then "ERROR: xcap_server [xcap_misc.c:736]: error setting xcap uri data...".

I think that it can be a limitation of the MAX URI length which
actually it's set to 128. Maybe also something else.
the error is because the size of http url is higher than 127. You can 
increase it, no problem, it is now 255 in devel version -- be aware you 
have to increase in the database xcap table as well the size of doc_uri.


Cheers,
Daniel



  We'll try to increase the max length definition and see what happen.
Any other suggestion?

Thank you much again.

Best Regards,
Laura

On Wed, Sep 7, 2011 at 10:37 AM, Daniel-Constantin Mierla
  wrote:

Hello,

On 9/6/11 3:25 PM, laura testi wrote:

Hi,
I am using the XCAP server of kamailio for contact list and presence
rules. It seems it only support to update the whole xcap doc of the
user but not the partial update. Can anyone tell me if the kamailio's
xcap server support the partial update of a user's doc? for example,
to remove a contact from the contact list or add a contact to the
contact list without PUT or DELETE the whole xcap document of this
user? If yes, what's the syntax of the HTTP request?


it should work using the node selector '~~' and then XPath format to point
the part to be updated. This is actually in the HTTP URL, rfc4825 has some
examples, iirc.

Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda




--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Accounting only the 2nd branch of missed serial forked call

2011-09-07 Thread Ozren Lapcevic
Hi Daniel,

thanks for the quick fix and reply.

What is the easiest way to try this new patch? I'm running kamailio 3.1.4
and there is no t_flush_flags() in tmx module in that version. I suppose I
need to install Kamailio Devel from git (
http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-devel-from-git)
to get t_flush flags() and your patch or is there a workaround to apply them
to my 3.1.4 branch?

Cheers
Ozren


On Tue, Sep 6, 2011 at 2:18 PM, Daniel-Constantin Mierla
wrote:

>  Hello,
>
> can you use t_flush_flags() after setting the accounting flag in
> falure_route? Automatic update was missing so far, reported by Alex Hermann
> as well. I just did a patch, so if you want to try it, see the commit:
>
>
> http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c589ca35b2aa3097a3c9e2a5a050514337300c05
>
> Actually, reporting if all goes fine with this patch, will help in
> backporting it to 3.1 branch.
>
> Thanks,
> Daniel
>
>
> On 9/5/11 2:41 PM, Ozren Lapcevic wrote:
>
> Hi,
>
> I'm having some problems accounting missed serial forked calls to mysql
> database.
>
> I have following setup. Each user can have up to two contacts: telephone
> number (routed to asterisk) and SIP URI. Users can specify which contact has
> higher priority - which one should ring first. There is also SEMS voicemail
> which is forked as 3rd serial call leg if there is no answer at first two
> contacts.
>
> For example, I have two users: o...@abc.hr and p...@abc.hr. p...@abc.hr also
> has set telephone number as alternative number if he is not reachable at
> sip:p...@abc.hr. Moreover, p...@abc.hr has voicemail turned on. When
> o...@abc.hr calls p...@abc.hr, first p...@abc.hr's SIP client rings, then if
> there is no answer and after the timeout telephone number rings and finally,
> if there is no answer at telephone and after the timeout INVITE is forked to
> SEMS.
>
> There are two interesting scenarios accounting-wise which can happened:
> 1. o...@abc.hr calls p...@abc.hr, there are no answers and call is forked to
> voicemail.
> 2. o...@abc.hr calls p...@abc.hr, there is no answer at SIP client, but pero
> answers call at telephone.
>
> When scenario 1 happens, I want to have only one log (row) in missed_calls
> table.
>
> When scenario 2 happens, I don't want to have a log in missed_calls table.
>
> To accomplish this,* I want to log only the 2nd branch of the forked call.
> However, there is either a bug in acc module or I'm doing something wrong,
> and I can't get Kamailio to log only the 2nd branch*. I think that I am
> setting the FLT_ACCMISSED flag correctly - after the 2nd branch is handled
> and prior to calling the RELAY route. Logs show that FLT_ACCMISSED flag is
> set prior to calling t_relay(), and there are no errors in debug log. I am
> using $ru = "something" to rewrite URI prior to forking request.
>
> I can easily set up logging of every call (two missed calls for serially
> forked call to two locations) by setting FLT_ACCMISSED flag for each INVITE.
> I can set up logging of every call's 1st branch, by reseting FLT_ACCMISSED
> flag when handling 2nd branch of the call. Interestingly, logging of only
> the 2nd branch of the serial forked call works when there is no forking to
> voicemail!
>
> Any ideas how to solve this problem?
>
> Bellow are important parts of my config file. I'm running kamailio 3.1.4.
>
> Cheers
> Ozren
>
>
> # - acc params -
> /* what special events should be accounted ? */
> modparam("acc", "early_media", 0)
> modparam("acc", "report_ack", 1)
> modparam("acc", "report_cancels", 0)
> modparam("acc", "detect_direction", 0)
> /* account triggers (flags) */
> modparam("acc", "log_flag", FLT_ACC)
> modparam("acc", "log_missed_flag", FLT_ACCMISSED)
> modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
> modparam("acc",
> "log_extra","src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
> /* enhanced DB accounting */
> #!ifdef WITH_ACCDB
> modparam("acc", "db_flag", FLT_ACC)
> modparam("acc", "db_missed_flag", FLT_ACCMISSED)
> modparam("acc", "db_url", DBURL)
> modparam("acc", "db_extra",
> "src_user=$fU;src_domain=$fd;dst_user=$tU;dst_domain=$td;src_ip=$si")
> #!endif
>
> ...
>
>
> # Main SIP request routing logic
> # - processing of any incoming SIP request starts with this route
> route {
>
> # per request initial checks
> route(REQINIT);
>
> if (src_ip != ) {
> # NAT detection
> route(NAT);
> }
>
> # handle requests within SIP dialogs
> route(WITHINDLG);
>
> ### only initial requests (no To tag)
>
> # CANCEL processing
> if (is_method("CANCEL"))
> {
> if (t_check_trans())
> t_relay();
> exit;
> }
>
> t_check_trans();
>
> # authentication
> route(AUTH);
>
> # record routing for dialog forming requests (in case they are
> route

Re: [SR-Users] Does xcap server of kamailio support partial update of xcap document?

2011-09-07 Thread laura testi
Hi Daniel,
thank you for your quick reply. We have already tried with node
selector '~~' after doc uri in the http XCAP PUT request. But We got
the error "ERROR: xcap_server [xcap_misc.c:60]: http uri too long"
 then "ERROR: xcap_server [xcap_misc.c:736]: error setting xcap uri data...".

I think that it can be a limitation of the MAX URI length which
actually it's set to 128. Maybe also something else.

 We'll try to increase the max length definition and see what happen.
Any other suggestion?

Thank you much again.

Best Regards,
Laura

On Wed, Sep 7, 2011 at 10:37 AM, Daniel-Constantin Mierla
 wrote:
> Hello,
>
> On 9/6/11 3:25 PM, laura testi wrote:
>>
>> Hi,
>> I am using the XCAP server of kamailio for contact list and presence
>> rules. It seems it only support to update the whole xcap doc of the
>> user but not the partial update. Can anyone tell me if the kamailio's
>> xcap server support the partial update of a user's doc? for example,
>> to remove a contact from the contact list or add a contact to the
>> contact list without PUT or DELETE the whole xcap document of this
>> user? If yes, what's the syntax of the HTTP request?
>>
> it should work using the node selector '~~' and then XPath format to point
> the part to be updated. This is actually in the HTTP URL, rfc4825 has some
> examples, iirc.
>
> Cheers,
> Daniel
>
> --
> Daniel-Constantin Mierla -- http://www.asipto.com
> Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
> http://linkedin.com/in/miconda -- http://twitter.com/miconda
>
>

___
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] permanent usrloc entries in Kamailio

2011-09-07 Thread Klaus Darilion


Am 07.09.2011 10:16, schrieb Daniel-Constantin Mierla:
> Hello,
> 
> On 9/6/11 3:54 PM, Klaus Darilion wrote:
>> Hi!
>>
>> Recently I had a problem with permanent usrloc entries when upgrading a
>> server from SER 0.9 to Kamailio 3.1.
>>
>> Obviously the problem was that the permanent entries had "flag=128" and
>> now expires=0 is used, see old thread:
>>
>> http://old.nabble.com/usrloc-permanent-records-and-strptime-td17668417.html
>>
>>
>> The strange thing is, that even setting the expiry to 2099-0.. did
>> not worked and Kamailio deleted the "expired" entries. Only setting it
>> to "1970-01-01 01:00:00" worked.
>>
>> Any ideas what could been wrong?
> what do you see if you dump UL entries via MI? By year 2038 it time_t
> will overflow and go negative in many 32b OSes.

I can not test anymore, but I guess that would have been the case.

Thanks
Klaus

___
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 User Role permissions

2011-09-07 Thread Daniel-Constantin Mierla

Hello,

On 8/29/11 7:45 PM, Camila Troncoso wrote:


Hi,

I have a question about the assignment of Role permissions to limit 
some Users privileges in Siremis. I defined a user , and then a Role 
denying some actions, but I couldn't deny the action from de SER menu 
. The Role permissions only show the modules on Application Menu  from 
Administration Tab . What if  I want to deny access to some items 
inside SER Menu , like modifying the ACL services or /and Rounting 
services?


I guess you would have to assign roles to the SER menu components, 
working with the xml files inside ser module directory.


Maybe you can find some documentation on phpopenbiz/cubi site or just 
look at the modules in the application menu to reverse engineer the 
roles mechanism. So far Siremis extension for SER was created for admin 
level purposes.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] question bout UA and BOX in same NAT

2011-09-07 Thread Daniel-Constantin Mierla

Hello,

On 9/6/11 8:53 AM, MingHon wrote:

Hello List,

Can i have UA in the same nat with the box and also UA in different 
nat at the same time?


My box is currrently working behind nat with ip 192.168.2.3 
and advertised_address is set to sip.mydomain.com 



is it possible to append the via header replace the sip.mydomain.com 
 to 192.168.2.3 ?
not sure I understand what you want to achieve. First you say that you 
want advertised address to be sip.mydomain.com but then you want it to 
be 192.168.2.3, which would be if you don't set advertised address 
parameter.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] Does xcap server of kamailio support partial update of xcap document?

2011-09-07 Thread Daniel-Constantin Mierla

Hello,

On 9/6/11 3:25 PM, laura testi wrote:

Hi,
I am using the XCAP server of kamailio for contact list and presence
rules. It seems it only support to update the whole xcap doc of the
user but not the partial update. Can anyone tell me if the kamailio's
xcap server support the partial update of a user's doc? for example,
to remove a contact from the contact list or add a contact to the
contact list without PUT or DELETE the whole xcap document of this
user? If yes, what's the syntax of the HTTP request?

it should work using the node selector '~~' and then XPath format to 
point the part to be updated. This is actually in the HTTP URL, rfc4825 
has some examples, iirc.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] permanent usrloc entries in Kamailio

2011-09-07 Thread Daniel-Constantin Mierla

Hello,

On 9/6/11 3:54 PM, Klaus Darilion wrote:

Hi!

Recently I had a problem with permanent usrloc entries when upgrading a
server from SER 0.9 to Kamailio 3.1.

Obviously the problem was that the permanent entries had "flag=128" and
now expires=0 is used, see old thread:

http://old.nabble.com/usrloc-permanent-records-and-strptime-td17668417.html

The strange thing is, that even setting the expiry to 2099-0.. did
not worked and Kamailio deleted the "expired" entries. Only setting it
to "1970-01-01 01:00:00" worked.

Any ideas what could been wrong?
what do you see if you dump UL entries via MI? By year 2038 it time_t 
will overflow and go negative in many 32b OSes.




Further I wonder why Kamailio uses 01:00:00 for the permanent entry? The
server is currently running in timezon CEST (UTC+2), thus IMO 02:00:00
would be more logical.

Above thread also mentions problems with day-light-saving changes. Are
there really problems? How do you solve those problems? I think the best
workaround is to set system time always to UTC.

Sticking to UTC is making easy the life with accounting as well.

Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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