Browse code

core:dlg: separate getContactHdr and getContactUri

Stefan Sayer authored on 19/08/2014 09:39:10
Showing 2 changed files
... ...
@@ -99,9 +99,15 @@ const char* AmBasicSipDialog::getStatusStr()
99 99
   return getStatusStr(status);
100 100
 }
101 101
 
102
-string AmBasicSipDialog::getContactHdr()
102
+string AmBasicSipDialog::getContactHdr() {
103
+  return
104
+    SIP_HDR_COLSP(SIP_HDR_CONTACT) "<"+ getContactUri() += ">" CRLF;
105
+}
106
+
107
+
108
+string AmBasicSipDialog::getContactUri()
103 109
 {
104
-  string contact_uri = SIP_HDR_COLSP(SIP_HDR_CONTACT) "<sip:";
110
+  string contact_uri = "sip:";
105 111
 
106 112
   if(!ext_local_tag.empty()) {
107 113
     contact_uri += local_tag + "@";
... ...
@@ -118,8 +124,6 @@ string AmBasicSipDialog::getContactHdr()
118 124
     contact_uri += ";" + contact_params;
119 125
   }
120 126
 
121
-  contact_uri += ">" CRLF;
122
-
123 127
   return contact_uri;
124 128
 }
125 129
 
... ...
@@ -310,6 +310,11 @@ public:
310 310
    */
311 311
   string getContactHdr();
312 312
 
313
+  /**
314
+   * Compute the Contact URI for the next request
315
+   */
316
+  string getContactUri();
317
+
313 318
   /**
314 319
    * Compute the Route-HF for the next request
315 320
    */