]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODSOFIA-50
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 25 Feb 2010 00:07:25 +0000 (00:07 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 25 Feb 2010 00:07:25 +0000 (00:07 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16806 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_glue.c

index cb38449ecc8f08ec5cad1700a94b1aaaa53a1aa8..7f00a55bcbc2237227880e9036297bfad158a691 100644 (file)
@@ -1246,6 +1246,49 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
 
                        has_ip++;
 
+               } else if (!strncmp("o=", p, 2)) {
+                       char *oe = strchr(p, '\n');
+                       switch_size_t len;
+                       
+                       if (oe) {
+                               const char *family = "IP4";
+                               char o_line[1024] = "";
+
+                               if (oe >= pe) {
+                                       bad = 5;
+                                       goto end;
+                               }
+
+                               len = (oe - p) + 1;
+                               p += len;
+                               
+                               
+                               family = strchr(tech_pvt->profile->sipip, ':') ? "IP6" : "IP4";
+
+                               if (!tech_pvt->owner_id) {
+                                       tech_pvt->owner_id = (uint32_t) switch_epoch_time_now(NULL) * 31821U + 13849U;
+                               }
+                               
+                               if (!tech_pvt->session_id) {
+                                       tech_pvt->session_id = tech_pvt->owner_id;
+                               }
+                               
+                               tech_pvt->session_id++;
+                               
+                               
+                               snprintf(o_line, sizeof(o_line), "o=%s %010u %010u IN %s %s\n", 
+                                                tech_pvt->profile->username,
+                                                tech_pvt->owner_id,
+                                                tech_pvt->session_id,
+                                                family,
+                                                tech_pvt->profile->sipip);
+                                               
+                               strncpy(q, o_line, strlen(o_line));
+                               q += strlen(o_line);
+                               
+                       }
+                       
+
                } else if (!strncmp("m=audio ", p, 8) || (!strncmp("m=image ", p, 8))) {
                        strncpy(q, p, 8);
                        p += 8;