Author: jih
Date: 2008-04-22 15:17:22 +0200 (Tue, 22 Apr 2008)
New Revision: 900

Modified:
   trunk/apps/webconference/Readme.webconference
   trunk/apps/webconference/WebConference.cpp
Log:
* Added optional "headers" argument to dialout function. If present,
  headers separated by | char are appended to outgoing INVITE request.
* Fixed a typo in asserting dialout args.


Modified: trunk/apps/webconference/Readme.webconference
===================================================================
--- trunk/apps/webconference/Readme.webconference       2008-04-21 12:18:21 UTC 
(rev 899)
+++ trunk/apps/webconference/Readme.webconference       2008-04-22 13:17:22 UTC 
(rev 900)
@@ -59,7 +59,7 @@
 ----
 dialout(string room, string adminpin, string callee,
         string from_user, string domain,
-        string auth_user, string auth_pwd) :
+        string auth_user, string auth_pwd [, headers]) :
      int code, string result, string callid
 
    code/result:

Modified: trunk/apps/webconference/WebConference.cpp
===================================================================
--- trunk/apps/webconference/WebConference.cpp  2008-04-21 12:18:21 UTC (rev 
899)
+++ trunk/apps/webconference/WebConference.cpp  2008-04-22 13:17:22 UTC (rev 
900)
@@ -412,7 +412,7 @@
 
 void WebConferenceFactory::dialout(const AmArg& args, AmArg& ret) {
   for (int i=0;i<6;i++)
-    assertArgCStr(args.get(1));
+    assertArgCStr(args.get(i));
 
   string room        = args.get(0).asCStr();
   string adminpin    = args.get(1).asCStr();
@@ -421,7 +421,24 @@
   string domain      = args.get(4).asCStr();
   string auth_user   = args.get(5).asCStr();
   string auth_pwd    = args.get(6).asCStr();
+  string headers;
 
+  try {
+      assertArgCStr(args.get(7));
+      headers = args.get(7).asCStr();
+      int i, len;
+      len = headers.length();
+      for (i = 0; i < len; i++) {
+         if (headers[i] == '|') headers[i] = '\n';
+      }
+      if (headers[len - 1] != '\n') {
+         headers += '\n';
+      }
+  }
+  catch (AmArg::OutOfBoundsException &e) {
+      headers = "";
+  }
+
   string from = "sip:" + from_user + "@" + domain;
   string to   = "sip:" + callee + "@" + domain;
 
@@ -445,7 +462,7 @@
   AmSession* s = AmUAC::dialout(room.c_str(), APP_NAME,  to,  
                                "<" + from +  ">", from, "<" + to + ">", 
                                string(""), // callid
-                               string(""), // headers
+                               headers, // headers
                                a);
   if (s) {
     string localtag = s->getLocalTag();

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to