[sr-dev] Migration of Open IMS Core to sip-router
Dragos Vingarzan
dragos.vingarzan at gmail.com
Fri Jul 24 14:42:06 CEST 2009
You are right, but Ancuta, which developed the attached patch, tells me that
the actual issue was when ser tried to generate an ACK on >299 responses for
calls to such URNs.
Anyway, if we talk so much about this, it's not such a big deal, so here it
is attached and here:
http://svn.berlios.de/viewcvs/openimscore?view=rev&rev=631
Cheers,
-Dragos
On Fri, Jul 24, 2009 at 2:17 PM, Klaus Darilion <
klaus.mailinglists at pernau.at> wrote:
>
>
> Dragos Vingarzan schrieb:
>
>>
>> * Core - support for emergency URI,
>>
>>
>> What is this exactly? Any reference to ietf/itu specs?
>>
>> I am not really sure myself as somebody else did the implementation. But
>> all the specs should be listed here: http://www.openimscore.org/emergency. And even for us this is still partly a branch with work in progress. The
>> thing was that ser was even crashing when it got some of these, so in any
>> case, even if not used, it would be a good patch.
>>
>> I'll have to do a diff and find out what was exactly changes as there were
>> to many things in the last 3-4 years. And we probably have some garbage
>> through that. I'll send the patch after some cleanup.
>>
>
>
> IIRC openser/ser can not parse service URNs. Usually, if a UAC initiates an
> emergency call, it looks like:
>
> INVITE urn:service:sos SIP/2.0
> Route: sip:uri-of-the-psap at example.com <sip%3Auri-of-the-psap at example.com>
> ;lr
> From: sip:user at domain.com <sip%3Auser at domain.com>;tag=123
> To: urn:service:sos
> ...
>
> Thus, the proxy does not even have to route based on the service URN, but
> just on the pre-loaded route-set. Nevertheless, the proxy must not crash or
> generate errors if the RURI and From/To URI does contain a service URN.
> Actually From/To/RURI are allowed to contain any URIs (also http URIs) -
> thus sr should supports parsing of these.
>
> regards
> klaus
>
--
Best Regards,
Dragos Vingarzan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20090724/3ec7322c/attachment-0001.htm>
-------------- next part --------------
Index: parser/msg_parser.h
===================================================================
--- parser/msg_parser.h (revision 630)
+++ parser/msg_parser.h (revision 631)
@@ -141,7 +141,8 @@
};
#endif
-enum _uri_type{ERROR_URI_T=0, SIP_URI_T, SIPS_URI_T, TEL_URI_T, TELS_URI_T};
+//types of URIs : error at parsing, SIP, SIPS, TEL, TELS, URN and CID
+enum _uri_type{ERROR_URI_T=0, SIP_URI_T, SIPS_URI_T, TEL_URI_T, TELS_URI_T, URN_T, CID_T};
typedef enum _uri_type uri_type;
enum _uri_flags{
URI_USER_NORMALIZE=1,
Index: parser/parse_uri.c
===================================================================
--- parser/parse_uri.c (revision 630)
+++ parser/parse_uri.c (revision 631)
@@ -124,6 +124,9 @@
#define SIP_SCH 0x3a706973
#define SIPS_SCH 0x73706973
#define TEL_SCH 0x3a6c6574
+#define TEL_SCH 0x3a6c6574
+#define URN_SCH 0x3a6e7275
+#define CID_SCH 0x3a646963
#define case_port( ch, var) \
case ch: \
@@ -384,6 +387,11 @@
else goto error_bad_uri;
}else if (scheme==TEL_SCH){
uri->type=TEL_URI_T;
+ }else if( scheme==URN_SCH){
+ uri->type=URN_T;
+ return URN_T;
+ }else if(scheme == CID_SCH){
+ uri->type = CID_T;
}else goto error_bad_uri;
s=p;
@@ -1127,6 +1135,12 @@
uri->host.s="";
uri->host.len=0;
break;
+ case URN_T:
+ LOG(L_ERR, "ERROR: parse_uri: not handling URN type\n");
+ goto error_bad_uri;
+ break;
+ case CID_T:
+ break;
case ERROR_URI_T:
LOG(L_ERR, "ERROR: parse_uri unexpected error (BUG?)\n");
goto error_bad_uri;
@@ -1377,7 +1391,8 @@
int parse_sip_msg_uri(struct sip_msg* msg)
{
char* tmp;
- int tmp_len;
+ int tmp_len, ret;
+
if (msg->parsed_uri_ok) return 1;
if (msg->new_uri.s){
@@ -1387,11 +1402,16 @@
tmp=msg->first_line.u.request.uri.s;
tmp_len=msg->first_line.u.request.uri.len;
}
- if (parse_uri(tmp, tmp_len, &msg->parsed_uri)<0){
+ ret = parse_uri(tmp, tmp_len, &msg->parsed_uri);
+ if(ret<0){
LOG(L_ERR, "ERROR: parse_sip_msg_uri: bad uri <%.*s>\n",
tmp_len, tmp);
msg->parsed_uri_ok=0;
return -1;
+ }else if(ret == URN_T){
+ LOG(L_DBG, "DBG: needs to be parsed as an URN\n");
+ }else if(ret == CID_T){
+ LOG(L_DBG, "DBG: needs to be parsed as a CID\n");
}
msg->parsed_uri_ok=1;
return 1;
Index: select_core.c
===================================================================
--- select_core.c (revision 630)
+++ select_core.c (revision 631)
@@ -677,6 +677,8 @@
strncpy(p+uri.host.len, ":5060", 5);
break;
case ERROR_URI_T:
+ case URN_T:
+ case CID_T:
return -1;
}
res->s = p;
More information about the sr-dev
mailing list