Browse code

update apps to 1.6 core

Václav Kubart authored on 08/02/2013 16:02:28 • Raphael Coeffic committed on 28/02/2013 12:11:27
Showing 6 changed files
... ...
@@ -249,11 +249,11 @@ void C2DCallerDialog::createCalleeSession()
249 249
 
250 250
   other_id = AmSession::getNewId();
251 251
 
252
-  callee_dlg->local_tag    = other_id;
253
-  callee_dlg->callid       = AmSession::getNewId();
254
-  callee_dlg->local_party  = dlg->local_party;
255
-  callee_dlg->remote_party = dlg->remote_party;
256
-  callee_dlg->remote_uri   = dlg->remote_uri;
252
+  callee_dlg->setLocalTag(other_id);
253
+  callee_dlg->setCallid(AmSession::getNewId());
254
+  callee_dlg->setLocalParty(dlg->getLocalParty());
255
+  callee_dlg->setRemoteParty(dlg->getRemoteParty());
256
+  callee_dlg->setRemoteUri(dlg->getRemoteUri());
257 257
 
258 258
   callee_session->start();
259 259
 
... ...
@@ -361,11 +361,11 @@ AmSession* ConferenceFactory::onRefer(const AmSipRequest& req, const string& app
361 361
     throw AmSession::Exception(488,"Not accepted here");
362 362
 
363 363
   AmSession* s = new ConferenceDialog(req.user);
364
-  s->dlg->local_tag  = req.from_tag;
364
+  s->dlg->setLocalTag(req.from_tag);
365 365
   
366 366
   setupSessionTimer(s);
367 367
 
368
-  DBG("ConferenceFactory::onRefer: local_tag = %s\n",s->dlg->local_tag.c_str());
368
+  DBG("ConferenceFactory::onRefer: local_tag = %s\n",s->dlg->getLocalTag().c_str());
369 369
 
370 370
   return s;
371 371
 }
... ...
@@ -716,7 +716,7 @@ void ConferenceDialog::onDtmf(int event, int duration)
716 716
   DBG("ConferenceDialog::onDtmf\n");
717 717
   if (dialedout || !allow_dialout ||
718 718
       ((ConferenceFactory::MaxParticipants > 0) &&
719
-       (AmConferenceStatus::getConferenceSize(dlg->user) >= 
719
+       (AmConferenceStatus::getConferenceSize(dlg->getUser()) >= 
720 720
 	ConferenceFactory::MaxParticipants)))
721 721
     return;
722 722
 
... ...
@@ -811,16 +811,16 @@ void ConferenceDialog::createDialoutParticipant(const string& uri_user)
811 811
 
812 812
   AmSipDialog* dialout_dlg = dialout_session->dlg;
813 813
 
814
-  dialout_dlg->local_tag    = dialout_id;
815
-  dialout_dlg->callid       = AmSession::getNewId();
814
+  dialout_dlg->setLocalTag(dialout_id);
815
+  dialout_dlg->setCallid(AmSession::getNewId());
816 816
 
817 817
   if (from_header.length() > 0) {
818
-    dialout_dlg->local_party  = from_header;
818
+    dialout_dlg->setLocalParty(from_header);
819 819
   } else {
820
-    dialout_dlg->local_party  = dlg->local_party;
820
+    dialout_dlg->setLocalParty(dlg->getLocalParty());
821 821
   }
822
-  dialout_dlg->remote_party = uri;
823
-  dialout_dlg->remote_uri   = uri;
822
+  dialout_dlg->setRemoteParty(uri);
823
+  dialout_dlg->setRemoteUri(uri);
824 824
 
825 825
   dialout_dlg->sendRequest(SIP_METH_INVITE,NULL,
826 826
 			  extra_headers);
... ...
@@ -900,10 +900,10 @@ void ConferenceDialog::onSipRequest(const AmSipRequest& req)
900 900
     dlg->route = getHeader(req.hdrs,"P-Transfer-RR", true);
901 901
   }
902 902
 
903
-  DBG("ConferenceDialog::onSipRequest: local_party = %s\n",dlg->local_party.c_str());
904
-  DBG("ConferenceDialog::onSipRequest: local_tag = %s\n",dlg->local_tag.c_str());
905
-  DBG("ConferenceDialog::onSipRequest: remote_party = %s\n",dlg->remote_party.c_str());
906
-  DBG("ConferenceDialog::onSipRequest: remote_tag = %s\n",dlg->remote_tag.c_str());
903
+  DBG("ConferenceDialog::onSipRequest: local_party = %s\n",dlg->getLocalParty().c_str());
904
+  DBG("ConferenceDialog::onSipRequest: local_tag = %s\n",dlg->getLocalTag().c_str());
905
+  DBG("ConferenceDialog::onSipRequest: remote_party = %s\n",dlg->getRemoteParty().c_str());
906
+  DBG("ConferenceDialog::onSipRequest: remote_tag = %s\n",dlg->getRemoteTag().c_str());
907 907
 
908 908
   dlg->sendRequest(SIP_METH_INVITE);
909 909
 
... ...
@@ -118,17 +118,17 @@ string resolveVars(const string ts, AmSession* sess,
118 118
       if (s1 == "local_tag")
119 119
 	return sess->getLocalTag();	
120 120
       else if (s1 == "user")
121
-	return sess->dlg->user;
121
+	return sess->dlg->getUser();
122 122
       else if (s1 == "domain")
123
-	return sess->dlg->domain;
123
+	return sess->dlg->getDomain();
124 124
       else if (s1 == "remote_tag")
125 125
 	return sess->getRemoteTag();
126 126
       else if (s1 == "callid")
127 127
 	return sess->getCallID();
128 128
       else if (s1 == "local_uri")
129
-	return sess->dlg->local_uri;
129
+	return sess->dlg->getLocalUri();
130 130
       else if (s1 == "remote_uri")
131
-	return sess->dlg->remote_uri;
131
+	return sess->dlg->getRemoteUri();
132 132
       else
133 133
 	return string();
134 134
     } 
... ...
@@ -95,17 +95,17 @@ extern "C" {
95 95
     if (!strcmp("local_tag", varname))
96 96
       res = sc_sess->getLocalTag();	
97 97
     else if (!strcmp("user", varname))
98
-      res = sc_sess->dlg->user;
98
+      res = sc_sess->dlg->getUser();
99 99
     else if (!strcmp("domain", varname))
100
-      res = sc_sess->dlg->domain;
100
+      res = sc_sess->dlg->getDomain();
101 101
     else if (!strcmp("remote_tag", varname))
102 102
       res = sc_sess->getRemoteTag();
103 103
     else if (!strcmp("callid", varname))
104 104
       res = sc_sess->getCallID();
105 105
     else if (!strcmp("local_uri", varname))
106
-      res = sc_sess->dlg->local_uri;
106
+      res = sc_sess->dlg->getLocalUri();
107 107
     else if (!strcmp("remote_uri", varname))
108
-      res = sc_sess->dlg->remote_uri;
108
+      res = sc_sess->dlg->getRemoteUri();
109 109
 
110 110
     DBG("returning '%s'\n", res.c_str());
111 111
 
... ...
@@ -107,12 +107,12 @@ void MWI::publish(const string& user, const string& domain)
107 107
   sms_body.setPayload((const unsigned char*)body.c_str(),body.length());
108 108
 
109 109
   AmSipDialog tmp_d(NULL);
110
-  tmp_d.local_party = string("<sip:mwi-publisher@") + presence_server + ">";
111
-  tmp_d.remote_party = domain.c_str();
112
-  tmp_d.route = "sip:" + presence_server;
113
-  tmp_d.remote_uri = "sip:" + user + "@" + domain;
114
-  tmp_d.callid = AmSession::getNewId() + "@" + presence_server;
115
-  tmp_d.local_tag = AmSession::getNewId();
110
+  tmp_d.setLocalParty(string("<sip:mwi-publisher@") + presence_server + ">");
111
+  tmp_d.setRemoteParty(domain.c_str());
112
+  tmp_d.setRouteSet("sip:" + presence_server);
113
+  tmp_d.setRemoteUri("sip:" + user + "@" + domain);
114
+  tmp_d.setCallid(AmSession::getNewId() + "@" + presence_server);
115
+  tmp_d.setLocalTag(AmSession::getNewId());
116 116
   tmp_d.sendRequest(SIP_METH_NOTIFY, &sms_body, headers);     
117 117
 };
118 118
 
... ...
@@ -71,7 +71,7 @@ WebConferenceDialog::~WebConferenceDialog()
71 71
   prompts.cleanup((long)this);
72 72
   play_list.flush();
73 73
   if (is_dialout || (InConference == state)) {
74
-    factory->updateStatus(is_dialout?dlg->user:conf_id, 
74
+    factory->updateStatus(is_dialout?dlg->getUser():conf_id, 
75 75
 			  getLocalTag(), 
76 76
 			  ConferenceRoomParticipant::Finished,
77 77
 			  "");
... ...
@@ -148,7 +148,7 @@ void WebConferenceDialog::onSessionStart() {
148 148
 	prompts.addToPlaylist(ENTER_PIN,  (long)this, play_list);
149 149
       } else {
150 150
 	DBG("########## direct connect conference '%s'  #########\n", conf_id.c_str());
151
-	if (!factory->newParticipant(conf_id, getLocalTag(), dlg->remote_party,
151
+	if (!factory->newParticipant(conf_id, getLocalTag(), dlg->getRemoteParty(),
152 152
 				     participant_id)) {
153 153
 	  DBG("inexisting conference room '%s\n", conf_id.c_str());
154 154
 	  state = PlayErrorFinish;
... ...
@@ -164,11 +164,11 @@ void WebConferenceDialog::onSessionStart() {
164 164
       }
165 165
     } else {
166 166
       setMute(false);
167
-      DBG("########## dialout: connect to conference '%s' #########\n", dlg->user.c_str()); 
167
+      DBG("########## dialout: connect to conference '%s' #########\n", dlg->getUser().c_str()); 
168 168
       state = InConference;
169 169
       setLocalInput(NULL);
170 170
       time(&connect_ts);
171
-      connectConference(dlg->user);
171
+      connectConference(dlg->getUser());
172 172
     }
173 173
   }
174 174
 
... ...
@@ -178,7 +178,7 @@ void WebConferenceDialog::onSessionStart() {
178 178
 void WebConferenceDialog::onRinging(const AmSipReply& rep) { 
179 179
   if (None == state || InConferenceEarly == state) {
180 180
     DBG("########## dialout: connect ringing session to conference '%s'  #########\n", 
181
-	dlg->user.c_str()); 
181
+	dlg->getUser().c_str()); 
182 182
 
183 183
     if(!RingTone.get())
184 184
       RingTone.reset(new AmRingTone(0,2000,4000,440,480)); // US
... ...
@@ -186,7 +186,7 @@ void WebConferenceDialog::onRinging(const AmSipReply& rep) {
186 186
     setLocalInput(RingTone.get());
187 187
 
188 188
     if (None == state) {
189
-      connectConference(dlg->user);
189
+      connectConference(dlg->getUser());
190 190
     }
191 191
     state = InConferenceRinging;
192 192
   }
... ...
@@ -197,10 +197,10 @@ void WebConferenceDialog::onEarlySessionStart() {
197 197
   if (None == state || InConferenceRinging == state) {
198 198
 
199 199
     DBG("########## dialout: connect early session to conference '%s'  #########\n", 
200
-	dlg->user.c_str());
200
+	dlg->getUser().c_str());
201 201
     setLocalInput(NULL);
202 202
     if (None == state) {
203
-      connectConference(dlg->user);
203
+      connectConference(dlg->getUser());
204 204
     }
205 205
     //    setMute(true);
206 206
 
... ...
@@ -251,7 +251,7 @@ void WebConferenceDialog::onSipReply(const AmSipRequest& req,
251 251
     default:break;
252 252
     }
253 253
     DBG("is dialout: updateing status\n");
254
-    factory->updateStatus(dlg->user, getLocalTag(), 
254
+    factory->updateStatus(dlg->getUser(), getLocalTag(), 
255 255
 			  rep_st, int2str(reply.code) + " " + reply.reason);
256 256
   }
257 257
 }
... ...
@@ -323,7 +323,7 @@ void WebConferenceDialog::process(AmEvent* ev)
323 323
       state = InConference;
324 324
       DBG("########## connectConference after pin entry #########\n");
325 325
 
326
-      if (!factory->newParticipant(pin_str, getLocalTag(), dlg->remote_party,
326
+      if (!factory->newParticipant(pin_str, getLocalTag(), dlg->getRemoteParty(),
327 327
 				   participant_id)) {
328 328
 	DBG("inexisting conference room '%s'\n", pin_str.c_str());
329 329
 	state = PlayErrorFinish;