[sr-dev] git:pd/outbound: core: added parsing of ; ob for URIs and Contact: headers

Peter Dunkley peter.dunkley at crocodile-rcs.com
Mon Dec 31 18:11:20 CET 2012


Module: sip-router
Branch: pd/outbound
Commit: 488bf3c94b2498e7539638202ee878c237fde567
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=488bf3c94b2498e7539638202ee878c237fde567

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Mon Dec 31 15:35:32 2012 +0000

core: added parsing of ;ob for URIs and Contact: headers

---

 parser/parse_param.c |   18 +++++++++++++++++-
 parser/parse_param.h |    5 ++++-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/parser/parse_param.c b/parser/parse_param.c
index 16e27d5..ac22387 100644
--- a/parser/parse_param.c
+++ b/parser/parse_param.c
@@ -152,7 +152,7 @@ static inline void parse_contact_class(param_hooks_t* _h, param_t* _p)
 			_h->contact.methods = _p;
 		}
 		break;
-		
+
 	case 'r':
 	case 'R':
 		if ((_p->name.len == 8) &&
@@ -172,6 +172,14 @@ static inline void parse_contact_class(param_hooks_t* _h, param_t* _p)
 			_h->contact.instance = _p;
 		}
 		break;
+	case 'o':
+	case 'O':
+		if ((_p->name.len == 2) &&
+		    (!strncasecmp(_p->name.s + 1, "b", 1))) {
+			_p->type = P_OB;
+			_h->contact.ob = _p;
+		}
+		break;
 	}
 }
 
@@ -252,6 +260,14 @@ static inline void parse_uri_class(param_hooks_t* _h, param_t* _p)
 			_h->uri.ftag = _p;
 		}
 		break;
+	case 'o':
+	case 'O':
+		if ((_p->name.len == 2) &&
+		    (!strncasecmp(_p->name.s + 1, "b", 1))) {
+			_p->type = P_OB;
+			_h->uri.ob = _p;
+		}
+		break;
 	}
 
 }
diff --git a/parser/parse_param.h b/parser/parse_param.h
index db7f401..d544f62 100644
--- a/parser/parse_param.h
+++ b/parser/parse_param.h
@@ -69,7 +69,8 @@ typedef enum ptype {
 	P_TO_TAG,    /*!< Dialog event package: to-tag */
 	P_ISD,       /*!< Dialog event package: include-session-description */
 	P_SLA,       /*!< Dialog event package: sla */
-	P_MA         /*!< Dialog event package: ma */
+	P_MA,        /*!< Dialog event package: ma */
+	P_OB         /*!< Contact|URI: ob parameter */
 } ptype_t;
 
 
@@ -106,6 +107,7 @@ struct contact_hooks {
 	struct param* received; /*!< received parameter */
 	struct param* instance; /*!< sip.instance parameter */
 	struct param* reg_id;   /*!< reg-id parameter */
+	struct param* ob;       /*!< ob parameter */
 };
 
 
@@ -121,6 +123,7 @@ struct uri_hooks {
 	struct param* dstip;     /*!< Destination IP */
 	struct param* dstport;   /*!< Destination port */
 	struct param* ftag;      /*!< From tag in the original request */
+	struct param* ob;        /*!< ob parameter */
 };
 
 




More information about the sr-dev mailing list