Module: sems Branch: master Commit: 492f3f13dd1b5ca692c28598b25e2d73215343ef URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=492f3f13dd1b5ca692c28598b25e2d73215343ef
Author: Raphael Coeffic <[email protected]> Committer: Raphael Coeffic <[email protected]> Date: Fri Mar 1 11:24:36 2013 +0100 c/f: ported ivr & rtmp modules to new dialog attribute setter & getter --- apps/ivr/Ivr.cpp | 18 +++++++++--------- apps/ivr/IvrSipDialog.cpp | 24 ++++++++++++------------ apps/rtmp/RtmpConnection.cpp | 21 +++++++++++---------- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/apps/ivr/Ivr.cpp b/apps/ivr/Ivr.cpp index a1c5194..74adc6e 100644 --- a/apps/ivr/Ivr.cpp +++ b/apps/ivr/Ivr.cpp @@ -799,25 +799,25 @@ void IvrDialog::createCalleeSession() other_id = AmSession::getNewId(); - callee_dlg->local_tag = other_id; - callee_dlg->callid = AmSession::getNewId(); + callee_dlg->setLocalTag(other_id); + callee_dlg->setCallid(AmSession::getNewId()); // this will be overwritten by ConnectLeg event - callee_dlg->remote_party = dlg->local_party; - callee_dlg->remote_uri = dlg->local_uri; + callee_dlg->setRemoteParty(dlg->getLocalParty()); + callee_dlg->setRemoteUri(dlg->getLocalUri()); if (b2b_callee_from_party.empty() && b2b_callee_from_uri.empty()) { // default: use the original To as From in the callee leg - callee_dlg->local_party = dlg->remote_party; - callee_dlg->local_uri = dlg->remote_uri; + callee_dlg->setLocalParty(dlg->getRemoteParty()); + callee_dlg->setLocalUri(dlg->getRemoteUri()); } else { // if given as parameters, use these - callee_dlg->local_party = b2b_callee_from_party; - callee_dlg->local_uri = b2b_callee_from_uri; + callee_dlg->setLocalParty(b2b_callee_from_party); + callee_dlg->setLocalUri(b2b_callee_from_uri); } DBG("Created B2BUA callee leg, From: %s\n", - callee_dlg->local_party.c_str()); + callee_dlg->getLocalParty().c_str()); callee_session->start(); diff --git a/apps/ivr/IvrSipDialog.cpp b/apps/ivr/IvrSipDialog.cpp index dc3fa2a..1b788bc 100644 --- a/apps/ivr/IvrSipDialog.cpp +++ b/apps/ivr/IvrSipDialog.cpp @@ -52,17 +52,17 @@ static PyObject* IvrSipDialog_new(PyTypeObject *type, PyObject *args, PyObject * return PyString_FromString(self->p_dlg->attr.c_str()); \ } \ -def_IvrSipDialog_GETTER(IvrSipDialog_getuser, user) -def_IvrSipDialog_GETTER(IvrSipDialog_getdomain, domain) -def_IvrSipDialog_GETTER(IvrSipDialog_getlocal_uri, local_uri) -def_IvrSipDialog_GETTER(IvrSipDialog_getremote_uri, remote_uri) +def_IvrSipDialog_GETTER(IvrSipDialog_getuser, getUser()) +def_IvrSipDialog_GETTER(IvrSipDialog_getdomain, getDomain()) +def_IvrSipDialog_GETTER(IvrSipDialog_getlocal_uri, getLocalUri()) +def_IvrSipDialog_GETTER(IvrSipDialog_getremote_uri, getRemoteUri()) //def_IvrSipDialog_GETTER(IvrSipDialog_getcontact_uri, contact_uri) -def_IvrSipDialog_GETTER(IvrSipDialog_getcallid, callid) -def_IvrSipDialog_GETTER(IvrSipDialog_getremote_tag, remote_tag) -def_IvrSipDialog_GETTER(IvrSipDialog_getlocal_tag, local_tag) -def_IvrSipDialog_GETTER(IvrSipDialog_getremote_party, remote_party) -def_IvrSipDialog_GETTER(IvrSipDialog_getlocal_party, local_party) -def_IvrSipDialog_GETTER(IvrSipDialog_getroute, route) +def_IvrSipDialog_GETTER(IvrSipDialog_getcallid, getCallid()) +def_IvrSipDialog_GETTER(IvrSipDialog_getremote_tag, getRemoteTag()) +def_IvrSipDialog_GETTER(IvrSipDialog_getlocal_tag, getLocalTag()) +def_IvrSipDialog_GETTER(IvrSipDialog_getremote_party, getRemoteParty()) +def_IvrSipDialog_GETTER(IvrSipDialog_getlocal_party, getLocalParty()) +def_IvrSipDialog_GETTER(IvrSipDialog_getroute, getRoute()) def_IvrSipDialog_GETTER(IvrSipDialog_getoutbound_proxy, outbound_proxy) #define def_IvrSipDialog_SETTER(setter_name, attr) \ @@ -73,11 +73,11 @@ def_IvrSipDialog_GETTER(IvrSipDialog_getoutbound_proxy, outbound_proxy) if(!PyArg_Parse(value,"s",&text)) \ return -1; \ \ - self->p_dlg->attr = text; \ + self->p_dlg->attr(text); \ return 0; \ } -def_IvrSipDialog_SETTER(IvrSipDialog_setremote_uri, remote_uri) +def_IvrSipDialog_SETTER(IvrSipDialog_setremote_uri, setRemoteUri) static PyObject* IvrSipDialog_getcseq(IvrSipDialog *self, void *closure) diff --git a/apps/rtmp/RtmpConnection.cpp b/apps/rtmp/RtmpConnection.cpp index 771dc43..b256e89 100644 --- a/apps/rtmp/RtmpConnection.cpp +++ b/apps/rtmp/RtmpConnection.cpp @@ -673,27 +673,28 @@ RtmpSession* RtmpConnection::startSession(const char* uri) AmSipDialog* dialout_dlg = n_session->dlg; string dialout_id = AmSession::getNewId(); - dialout_dlg->local_tag = dialout_id; - dialout_dlg->callid = AmSession::getNewId(); + dialout_dlg->setLocalTag(dialout_id); + dialout_dlg->setCallid(AmSession::getNewId()); - dialout_dlg->remote_party = "<" + string(uri) + ">"; - dialout_dlg->remote_uri = uri; + dialout_dlg->setRemoteParty("<" + string(uri) + ">"); + dialout_dlg->setRemoteUri(uri); - dialout_dlg->local_party = "\"" + rtmp_cfg->FromName + "\" " - "<sip:" + ident + "@"; + string local_party = + "\"" + rtmp_cfg->FromName + "\" <sip:" + ident + "@"; if(!rtmp_cfg->FromDomain.empty()){ - dialout_dlg->local_party += rtmp_cfg->FromDomain; + local_party += rtmp_cfg->FromDomain; } else { int out_if = dialout_dlg->getOutboundIf(); - dialout_dlg->local_party += AmConfig::SIP_Ifs[out_if].LocalIP; + local_party += AmConfig::SIP_Ifs[out_if].LocalIP; if(AmConfig::SIP_Ifs[out_if].LocalPort != 5060) - dialout_dlg->local_party += + local_party += ":" + int2str(AmConfig::SIP_Ifs[out_if].LocalPort); } - dialout_dlg->local_party += ">"; + local_party += ">"; + dialout_dlg->setLocalParty(local_party); n_session->setCallgroup(dialout_id); switch(AmSessionContainer::instance()->addSession(dialout_id, _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
