|
@@ -1,14 +1,14 @@
|
|
|
/*
|
|
|
- * Kamailio osp module.
|
|
|
+ * Kamailio osp module.
|
|
|
*
|
|
|
- * This module enables Kamailio to communicate with an Open Settlement
|
|
|
- * Protocol (OSP) server. The Open Settlement Protocol is an ETSI
|
|
|
+ * This module enables Kamailio to communicate with an Open Settlement
|
|
|
+ * Protocol (OSP) server. The Open Settlement Protocol is an ETSI
|
|
|
* defined standard for Inter-Domain VoIP pricing, authorization
|
|
|
- * and usage exchange. The technical specifications for OSP
|
|
|
+ * and usage exchange. The technical specifications for OSP
|
|
|
* (ETSI TS 101 321 V4.1.1) are available at www.etsi.org.
|
|
|
*
|
|
|
* Uli Abend was the original contributor to this module.
|
|
|
- *
|
|
|
+ *
|
|
|
* Copyright (C) 2001-2005 Fhg Fokus
|
|
|
*
|
|
|
* This file is part of Kamailio, a free SIP server.
|
|
@@ -45,8 +45,8 @@ extern int _osp_use_rpid;
|
|
|
static void ospSkipPlus(char *e164);
|
|
|
static int ospAppendHeader(struct sip_msg *msg, str *header);
|
|
|
|
|
|
-/*
|
|
|
- * Copy str to buffer and check overflow
|
|
|
+/*
|
|
|
+ * Copy str to buffer and check overflow
|
|
|
* param source Str
|
|
|
* param buffer Buffer
|
|
|
* param buffersize Size of buffer
|
|
@@ -68,7 +68,7 @@ void ospCopyStrToBuffer(str *source, char *buffer, int buffersize)
|
|
|
buffer[copybytes] = '\0';
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Remove '+' in E164 string
|
|
|
* param e164 E164 string
|
|
|
*/
|
|
@@ -80,7 +80,7 @@ static void ospSkipPlus(char *e164)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Get calling number from From header
|
|
|
* param msg SIP message
|
|
|
* param fromuser User part of From header
|
|
@@ -115,7 +115,7 @@ int ospGetFromUserpart(struct sip_msg *msg, char *fromuser, int buffersize)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Get calling number from Remote-Party-ID header
|
|
|
* param msg SIP message
|
|
|
* param rpiduser User part of Remote-Party-ID header
|
|
@@ -154,7 +154,7 @@ int ospGetRpidUserpart(struct sip_msg *msg, char *rpiduser, int buffersize)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Get called number from To header
|
|
|
* param msg SIP message
|
|
|
* param touser User part of To header
|
|
@@ -189,7 +189,7 @@ int ospGetToUserpart(struct sip_msg *msg, char *touser, int buffersize)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Get called number from Request-Line header
|
|
|
* param msg SIP message
|
|
|
* param touser User part of To header
|
|
@@ -213,7 +213,7 @@ int ospGetUriUserpart(struct sip_msg *msg, char *uriuser, int buffersize)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Append header to SIP message
|
|
|
* param msg SIP message
|
|
|
* param header Header to be appended
|
|
@@ -257,7 +257,7 @@ static int ospAppendHeader(struct sip_msg *msg, str *header)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Add OSP token header to SIP message
|
|
|
* param msg SIP message
|
|
|
* param token OSP authorization token
|
|
@@ -300,7 +300,7 @@ int ospAddOspHeader(
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Get OSP token from SIP message
|
|
|
* param msg SIP message
|
|
|
* param token OSP authorization token
|
|
@@ -338,7 +338,7 @@ int ospGetOspHeader(
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Get first VIA header and use the IP or host name
|
|
|
* param msg SIP message
|
|
|
* param sourceaddress Source address
|
|
@@ -352,9 +352,9 @@ int ospGetSourceAddress(
|
|
|
struct via_body *via;
|
|
|
int result = -1;
|
|
|
|
|
|
- /*
|
|
|
+ /*
|
|
|
* No need to call parse_headers, called already and VIA is parsed
|
|
|
- * anyway by default
|
|
|
+ * anyway by default
|
|
|
*/
|
|
|
for(hf = msg->headers; hf; hf = hf->next) {
|
|
|
if(hf->type == HDR_VIA_T) {
|
|
@@ -372,7 +372,7 @@ int ospGetSourceAddress(
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Get Call-ID header from SIP message
|
|
|
* param msg SIP message
|
|
|
* param callid Call ID
|
|
@@ -399,7 +399,7 @@ int ospGetCallId(struct sip_msg *msg, OSPTCALLID **callid)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Get route parameters from the 1st Route or Request-Line
|
|
|
* param msg SIP message
|
|
|
* param routeparameters Route parameters
|
|
@@ -453,7 +453,7 @@ int ospGetRouteParameters(
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Rebuild URI using called number, destination IP, and port
|
|
|
* param newuri URI to be built
|
|
|
* param called Called number
|
|
@@ -519,7 +519,7 @@ int ospRebuildDestionationUri(
|
|
|
*buffer++ = '>';
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
+ /*
|
|
|
*buffer++ = ' ';
|
|
|
*buffer++ = 'S';
|
|
|
*buffer++ = 'I';
|
|
@@ -541,7 +541,7 @@ int ospRebuildDestionationUri(
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
+/*
|
|
|
* Get next hop using the first Route not generated by this proxy or URI from the Request-Line
|
|
|
* param msg SIP message
|
|
|
* param nexthop Next hop IP
|