Module: sip-router Branch: master Commit: 855a6b2821db5097d80d3a4fe5ddb7deacad3664 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=855a6b28...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Wed Jul 6 23:17:30 2011 +0200
pv: new pv $rz returns r-uri scheme
- possible values: sip, sips, tel and tels - r-uri scheme parsing error should be reflected by value: none
---
modules_k/pv/pv.c | 3 +++ modules_k/pv/pv_core.c | 11 +++++++++++ 2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/modules_k/pv/pv.c b/modules_k/pv/pv.c index 8009be7..3beb7bc 100644 --- a/modules_k/pv/pv.c +++ b/modules_k/pv/pv.c @@ -316,6 +316,9 @@ static pv_export_t mod_pvs[] = { {{"rv", (sizeof("rv")-1)}, /* */ PVT_OTHER, pv_get_version, 0, 0, 0, 0, 0}, + {{"rz", (sizeof("rz")-1)}, /* */ + PVT_OTHER, pv_get_ruri_attr, 0, + 0, 0, pv_init_iname, 5}, {{"Ri", (sizeof("Ri")-1)}, /* */ PVT_OTHER, pv_get_rcvip, 0, 0, 0, 0, 0}, diff --git a/modules_k/pv/pv_core.c b/modules_k/pv/pv_core.c index 698bda0..7c45e73 100644 --- a/modules_k/pv/pv_core.c +++ b/modules_k/pv/pv_core.c @@ -52,6 +52,14 @@ static str str_udp = { "UDP", 3 }; static str str_5060 = { "5060", 4 }; static str pv_str_1 = { "1", 1 }; +static str pv_uri_scheme[] = { + { "none", 4 }, + { "sip", 3 }, + { "sips", 4 }, + { "tel", 3 }, + { "tels", 4 }, + { 0, 0 } + };
int _pv_pid = 0;
@@ -271,6 +279,9 @@ int pv_get_xuri_attr(struct sip_msg *msg, struct sip_uri *parsed_uri, return pv_get_udp(msg, param, res); return pv_get_strintval(msg, param, res, &parsed_uri->transport_val, (int)parsed_uri->proto); + } else if(param->pvn.u.isname.name.n==5) /* uri scheme */ { + return pv_get_strintval(msg, param, res, &pv_uri_scheme[parsed_uri->type], + (int)parsed_uri->type); } LM_ERR("unknown specifier\n"); return pv_get_null(msg, param, res);
Am 06.07.2011 23:20, schrieb Daniel-Constantin Mierla:
Module: sip-router Branch: master Commit: 855a6b2821db5097d80d3a4fe5ddb7deacad3664 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=855a6b28...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Wed Jul 6 23:17:30 2011 +0200
pv: new pv $rz returns r-uri scheme
- possible values: sip, sips, tel and tels
- r-uri scheme parsing error should be reflected by value: none
btw: Kamailio also fails to handle service URNs in RURI. I tried some days ago and when assigning a service URN to RURI the parse complains as it fails to parse it as SIP URI.
Stateless forwarding (setting $du) works fine, t_relay() fails as it expects a SIP URI in $ru.
regards Klaus
How is a URN supposed to be routed?
El 07/07/2011 14:52, "Klaus Darilion" klaus.mailinglists@pernau.at escribió:
Am 06.07.2011 23:20, schrieb Daniel-Constantin Mierla:
Module: sip-router Branch: master Commit: 855a6b2821db5097d80d3a4fe5ddb7deacad3664 URL: h...
btw: Kamailio also fails to handle service URNs in RURI. I tried some days ago and when assigning a service URN to RURI the parse complains as it fails to parse it as SIP URI.
Stateless forwarding (setting $du) works fine, t_relay() fails as it expects a SIP URI in $ru.
regards Klaus
_______________________________________________ sr-dev mailing list sr-dev@lists.sip-router.org htt...
2011/7/9 Iñaki Baz Castillo ibc@aliax.net:
How is a URN supposed to be routed?
Better now from a real mail client rather than Android Gmail client, which forces using top-posting :)
AFAIK an URN URI is not routeable, which mean that a SIP proxy receiving it must translate it into a SIP URI (or deliver the request without chaning the RURI to other server, so in the case of Kamailio it would achieved via setting $du or calling t_relay("IP:PORT")).
Maybe I'm wrong?
Regards.
Am 10.07.2011 01:38, schrieb Iñaki Baz Castillo:
2011/7/9 Iñaki Baz Castillo ibc@aliax.net:
How is a URN supposed to be routed?
Better now from a real mail client rather than Android Gmail client, which forces using top-posting :)
AFAIK an URN URI is not routeable, which mean that a SIP proxy receiving it must translate it into a SIP URI (or deliver the request without chaning the RURI to other server, so in the case of Kamailio it would achieved via setting $du or calling t_relay("IP:PORT")).
Maybe I'm wrong?
This is what I tested: $ru contains a URN and $du contains a SIP URI. There are lots of "warnings" but it works using sl module. But it does not work usiong tm module which raises an error.
regards klaus
2011/7/11 Klaus Darilion klaus.mailinglists@pernau.at:
This is what I tested: $ru contains a URN and $du contains a SIP URI. There are lots of "warnings" but it works using sl module. But it does not work usiong tm module which raises an error.
It should work as $du is set. Could you please test setting a tel URI in the RURI? This is:
$ru = "tel:+12345678"; $du = "sip:someserver.com"; t_relay();
It should work with no warnings. And the same should be true for a URN URI in the RURI (or whatever in fact).
Am 11.07.2011 12:39, schrieb Iñaki Baz Castillo:
2011/7/11 Klaus Darilion klaus.mailinglists@pernau.at:
This is what I tested: $ru contains a URN and $du contains a SIP URI. There are lots of "warnings" but it works using sl module. But it does not work usiong tm module which raises an error.
It should work as $du is set. Could you please test setting a tel URI in the RURI? This is:
$ru = "tel:+12345678"; $du = "sip:someserver.com"; t_relay();
It should work with no warnings.
True!
And the same should be true for a URN URI in the RURI (or whatever in fact).
Unfortunately it is not the case:
$ru = "urn:service:sos"; -> ERROR: pv [pv_core.c:186]: failed to parse the R-URI $du = "sip:someserver.com"; t_relay(); -> ERROR: tm [t_lookup.c:1331]: ERROR: new_t: uri invalid -> ERROR: tm [t_lookup.c:1478]: ERROR: t_newtran: new_t failed
regards Klaus
2011/7/12 Klaus Darilion klaus.mailinglists@pernau.at:
And the same should be true for a URN URI in the RURI (or whatever in fact).
Unfortunately it is not the case:
$ru = "urn:service:sos"; -> ERROR: pv [pv_core.c:186]: failed to parse the R-URI $du = "sip:someserver.com"; t_relay(); -> ERROR: tm [t_lookup.c:1331]: ERROR: new_t: uri invalid -> ERROR: tm [t_lookup.c:1478]: ERROR: t_newtran: new_t failed
So it must be a bug.
On Wednesday 06 July 2011 23:20:35 Daniel-Constantin Mierla wrote:
pv: new pv $rz returns r-uri scheme
- possible values: sip, sips, tel and tels
- r-uri scheme parsing error should be reflected by value: none
Shouldn't http and https be possible too? If i understood correctly, the xmlrpc module receives requests over http?
Really nice :)
El 06/07/2011 22:20, "Daniel-Constantin Mierla" miconda@gmail.com escribió:
Module: sip-router Branch: master Commit: 855a6b2821db5097d80d3a4fe5ddb7deacad3664 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=855a6b28...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Wed Jul 6 23:17:30 2011 +0200
pv: new pv $rz returns r-uri scheme
- possible values: sip, sips, tel and tels - r-uri scheme parsing error should be reflected by value: none
---
modules_k/pv/pv.c | 3 +++ modules_k/pv/pv_core.c | 11 +++++++++++ 2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/modules_k/pv/pv.c b/modules_k/pv/pv.c index 8009be7..3beb7bc 100644 --- a/modules_k/pv/pv.c +++ b/modules_k/pv/pv.c @@ -316,6 +316,9 @@ static pv_export_t mod_pvs[] = { {{"rv", (sizeof("rv")-1)}, /* */ PVT_OTHER, pv_get_version, 0, 0, 0, 0, 0}, + {{"rz", (sizeof("rz")-1)}, /* */ + PVT_OTHER, pv_get_ruri_attr, 0, + 0, 0, pv_init_iname, 5}, {{"Ri", (sizeof("Ri")-1)}, /* */ PVT_OTHER, pv_get_rcvip, 0, 0, 0, 0, 0}, diff --git a/modules_k/pv/pv_core.c b/modules_k/pv/pv_core.c index 698bda0..7c45e73 100644 --- a/modules_k/pv/pv_core.c +++ b/modules_k/pv/pv_core.c @@ -52,6 +52,14 @@ static str str_udp = { "UDP", 3 }; static str str_5060 = { "5060", 4 }; static str pv_str_1 = { "1", 1 }; +static str pv_uri_scheme[] = { + { "none", 4 }, + { "sip", 3 }, + { "sips", 4 }, + { "tel", 3 }, + { "tels", 4 }, + { 0, 0 } + };
int _pv_pid = 0;
@@ -271,6 +279,9 @@ int pv_get_xuri_attr(struct sip_msg *msg, struct sip_uri *parsed_uri, return pv_get_udp(msg, param, res); return pv_get_strintval(msg, param, res, &parsed_uri->transport_val, (int)parsed_uri->proto); + } else if(param->pvn.u.isname.name.n==5) /* uri scheme */ { + return pv_get_strintval(msg, param, res, &pv_uri_scheme[parsed_uri->type], + (int)parsed_uri->type); } LM_ERR("unknown specifier\n"); return pv_get_null(msg, param, res);
_______________________________________________ sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev