[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Aug 25 12:12:45 CDT 2010


branch "master" has been updated
       via  9388404b91a4b71e6c162bdf9929aa46ad210fbf (commit)
       via  1d13a188214e8e85e5e6df5446b1a2e60dfdd175 (commit)
       via  187abdc90286815ba38096dd4d9c0c8dccd42c98 (commit)
       via  8823216711018c4c9d0ec1ca1e11b745ce2c90c9 (commit)
       via  9d44848876c5c1af3e1750ab4f59707c8ece0532 (commit)
      from  86149b958739dba752efacf1c6679f3faf4322af (commit)

Summary of changes:
 config/test_sip.conf       |    2 +
 slice                      |    2 +-
 src/PJSipSessionModule.cpp |    1 +
 src/SipEndpoint.cpp        |   54 +++++++++++++++++++++----------------------
 4 files changed, 30 insertions(+), 29 deletions(-)


- Log -----------------------------------------------------------------
commit 9388404b91a4b71e6c162bdf9929aa46ad210fbf
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Aug 25 14:24:36 2010 -0300

    Initialize 100rel support on the SIP endpoint. It's a required module when doing UAC stuff.

diff --git a/config/test_sip.conf b/config/test_sip.conf
index 9b7c0cb..7e936ad 100644
--- a/config/test_sip.conf
+++ b/config/test_sip.conf
@@ -2,6 +2,7 @@
 
 # Adapter parameters for this component
 SipChannelServiceAdapter.Endpoints=default
+SipChannelServiceAdapter.ThreadPool.Size=4
 
 # A proxy to the IceStorm topic manager
 TopicManager.Proxy=HydraIceStorm/TopicManager:default -p 10000
@@ -11,3 +12,4 @@ LocatorServiceManagement.Proxy=LocatorServiceManagement:tcp -p 5674
 
 # A proxy to the service locator service
 LocatorService.Proxy=LocatorService:tcp -p 2657
+
diff --git a/slice b/slice
index d6b2777..dcb271b 160000
--- a/slice
+++ b/slice
@@ -1 +1 @@
-Subproject commit d6b2777545b3b8eae7c5dc9b40a1ca3ff9e26a43
+Subproject commit dcb271baaca90fa89ed6b7d4846ea458fb303943
diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 4233dfe..99ee7da 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -355,6 +355,7 @@ PJSipSessionModule::PJSipSessionModule() : mName("Session Module")
 	pjsip_endpoint *endpt = manager->getEndpoint();
 	pjsip_tsx_layer_init_module(endpt);
 	pjsip_ua_init_module(endpt, &mUaParam);
+	pjsip_100rel_init_module(endpt);
 	pjsip_inv_usage_init(endpt, &mInvCallback);
 	manager->registerModule(&mModule);
 }

commit 1d13a188214e8e85e5e6df5446b1a2e60dfdd175
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Aug 25 14:23:40 2010 -0300

    Produce a valid SDP.

diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index 972334f..0878a4e 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -25,7 +25,7 @@ public:
 
 	   // TODO: Based on configuration populate the IP address for this remote URI
 	   char remote[64];
-	   pj_ansi_sprintf(remote, "sip:%s:%d", "127.0.0.1", 5060);
+	   pj_ansi_sprintf(remote, "sip:%s:%d", "216.237.114.82", 5060);
 	   remote_uri = pj_str(remote);
 
 	   // Create a UAC dialog for the outgoing call
@@ -34,6 +34,9 @@ public:
 	      return false;
 	   }
 
+	   // Since the SDP generation requires a pool we use the dialog one, so it has to be set here
+	   mEndpoint->setDialog(dialog);
+
 	   pjmedia_sdp_session *sdp = mEndpoint->createSDPOffer();
 
 	   // Create an INVITE session
@@ -54,7 +57,6 @@ public:
 	   }
 
 	   // Before we send the message we probably should populate the endpoint data... just in case
-	   mEndpoint->setDialog(dialog);
 	   mEndpoint->setInviteSession(inviteSession);
 	   mEndpoint->setSignalCallback(callback);
 
@@ -256,15 +258,14 @@ pjmedia_sdp_session *SipEndpoint::createSDPOffer()
 {
    pjmedia_sdp_session *sdp = static_cast<pjmedia_sdp_session*>(pj_pool_zalloc(mDialog->pool, sizeof(pjmedia_sdp_session)));
 
-   char user[] = "AsteriskSCF";
-   sdp->origin.user = pj_str(user);
-   sdp->origin.version = 0;
-   char net_type[] = "IN";
-   sdp->origin.net_type = pj_str(net_type);
-   char addr_type[] = "IPV4";
-   sdp->origin.addr_type = pj_str(addr_type);
+   pj_strdup2(mDialog->pool, &sdp->origin.user, "AsteriskSCF");
+   pj_time_val tv;
+   pj_gettimeofday(&tv);
+   sdp->origin.version = sdp->origin.id = tv.sec + 2208988800UL;
+   pj_strdup2(mDialog->pool, &sdp->origin.net_type, "IN");
+   pj_strdup2(mDialog->pool, &sdp->origin.addr_type, "IP4");
    sdp->origin.addr = *pj_gethostname();
-   sdp->name = pj_str(user);
+   pj_strdup2(mDialog->pool, &sdp->name, "sip");
    sdp->time.start = 0;
    sdp->time.stop = 0;
    sdp->attr_count = 0;
@@ -274,22 +275,21 @@ pjmedia_sdp_session *SipEndpoint::createSDPOffer()
 
    // Add connection details at the session level since we currently only support one media stream.
    sdp->conn = static_cast<pjmedia_sdp_conn*>(pj_pool_zalloc(mDialog->pool, sizeof(pjmedia_sdp_conn)));
-   sdp->conn->net_type = pj_str(net_type);
-   sdp->conn->addr_type = pj_str(addr_type);
-   sdp->conn->addr = pj_str((char*)stream->getLocalAddress().c_str());
+   sdp->conn->net_type = sdp->origin.net_type;
+   sdp->conn->addr_type = sdp->origin.addr_type;
+   pj_strdup2(mDialog->pool, &sdp->conn->addr, stream->getLocalAddress().c_str());
 
    // Add a single media stream
    sdp->media_count = 1;
-   sdp->media[0] = static_cast<pjmedia_sdp_media*>(pj_pool_zalloc(mDialog->pool, sizeof(pjmedia_sdp_media)));
-   char desc_media[] = "audio";
-   sdp->media[0]->desc.media = pj_str(desc_media);
-   sdp->media[0]->desc.port = stream->getLocalPort();
-   sdp->media[0]->desc.port_count = 1;
-   char desc_transport[] = "RTP/AVP";
-   sdp->media[0]->desc.transport = pj_str(desc_transport);
+   pjmedia_sdp_media* media = static_cast<pjmedia_sdp_media*>(pj_pool_zalloc(mDialog->pool, sizeof(pjmedia_sdp_media)));
+   sdp->media[0] = media;
+   pj_strdup2(mDialog->pool, &media->desc.media, "audio");
+   media->desc.port = stream->getLocalPort();
+   media->desc.port_count = 1;
+   pj_strdup2(mDialog->pool, &media->desc.transport, "RTP/AVP");
 
    // Populate the stream with codec details
-   sdp->media[0]->desc.fmt_count = 0;
+   sdp->media[0]->desc.fmt_count = 1;
    sdp->media[0]->attr_count = 0;
 
    // TODO: We should iterate over the formats to produce this instead of hardcoding
@@ -297,19 +297,17 @@ pjmedia_sdp_session *SipEndpoint::createSDPOffer()
    pjmedia_sdp_attr *attr;
 
    // This is hardcoded value for ULAW for now
-   char pt[] = "0";
-   rtpmap.pt = pj_str(pt);
+   pj_strdup2(mDialog->pool, &media->desc.fmt[0], "0");
+   rtpmap.pt = media->desc.fmt[0];
    rtpmap.clock_rate = 8000;
-   char enc_name[] = "PCMU";
-   rtpmap.enc_name = pj_str(enc_name);
+   pj_strdup2(mDialog->pool, &rtpmap.enc_name, "PCMU");
    rtpmap.param.slen = 0;
    pjmedia_sdp_rtpmap_to_attr(mDialog->pool, &rtpmap, &attr);
    sdp->media[0]->attr[sdp->media[0]->attr_count++] = attr;
 
    // Might as well add sendrecv
    attr = static_cast<pjmedia_sdp_attr*>(pj_pool_zalloc(mDialog->pool, sizeof(pjmedia_sdp_attr)));
-   char sendrecv[] = "sendrecv";
-   attr->name = pj_str(sendrecv);
+   pj_strdup2(mDialog->pool, &attr->name, "sendrecv");
    sdp->media[0]->attr[sdp->media[0]->attr_count++] = attr;
 
    return sdp;

commit 187abdc90286815ba38096dd4d9c0c8dccd42c98
Merge: 8823216 86149b9
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Aug 25 12:25:29 2010 -0300

    Merge branch 'master' of git.asterisk.org:asterisk-scf/integration/sip


commit 8823216711018c4c9d0ec1ca1e11b745ce2c90c9
Merge: 9d44848 33cb866
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Aug 25 12:20:28 2010 -0300

    Merge branch 'master' of git.asterisk.org:asterisk-scf/integration/sip


commit 9d44848876c5c1af3e1750ab4f59707c8ece0532
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Aug 25 11:45:19 2010 -0300

    Until EndpointId is flushed out completely just use a unique identifier for the destination identifier.

diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index 75d72a1..972334f 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -210,7 +210,7 @@ SipEndpoint::SipEndpoint(Ice::ObjectAdapterPtr adapter, boost::shared_ptr<SipEnd
 {
    id = new Hydra::Core::Endpoint::V1::EndpointId();
    id->endpointManagerId = "pjsip";
-   id->destinationId = "test";
+   id->destinationId = IceUtil::generateUUID();
 
    mSignalCommands = new SipSignalCommands(this);
    command = Hydra::Session::V1::SignalCommandsPrx::uncheckedCast(adapter->addWithUUID(mSignalCommands));

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list