Skip to content
Snippets Groups Projects
Commit 3267e5f8 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2165] Debugging sip call failed

parent 298b37de
Branches
Tags
No related merge requests found
...@@ -175,16 +175,24 @@ int Sdp::create_initial_offer() ...@@ -175,16 +175,24 @@ int Sdp::create_initial_offer()
status = create_local_offer(); status = create_local_offer();
if (status != PJ_SUCCESS) { if (status != PJ_SUCCESS) {
_debug (" Error: Failled to create initial offer\n");
return status; return status;
} }
// Create the SDP negociator instance with local offer // Create the SDP negociator instance with local offer
status = pjmedia_sdp_neg_create_w_local_offer (_pool, get_local_sdp_session(), &_negociator); status = pjmedia_sdp_neg_create_w_local_offer (_pool, get_local_sdp_session(), &_negociator);
if (status != PJ_SUCCESS) {
_debug (" Error: Failled to create an initial SDP negociator\n");
return status;
}
state = pjmedia_sdp_neg_get_state (_negociator); state = pjmedia_sdp_neg_get_state (_negociator);
PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1);
_debug (" Initial offer created succesfully\n");
return PJ_SUCCESS; return PJ_SUCCESS;
} }
......
...@@ -357,7 +357,7 @@ std::string SIPVoIPLink::get_useragent_name (void) ...@@ -357,7 +357,7 @@ std::string SIPVoIPLink::get_useragent_name (void)
void void
SIPVoIPLink::getEvent() SIPVoIPLink::getEvent()
{ {
// We have to register the external thread so it could access the pjsip framework // We have to register the external thread so it could access the pjsip frameworks
if (!pj_thread_is_registered()) if (!pj_thread_is_registered())
pj_thread_register (NULL, desc, &thread); pj_thread_register (NULL, desc, &thread);
...@@ -1239,6 +1239,7 @@ SIPVoIPLink::SIPStartCall (SIPCall* call, const std::string& subject UNUSED) ...@@ -1239,6 +1239,7 @@ SIPVoIPLink::SIPStartCall (SIPCall* call, const std::string& subject UNUSED)
status = pjsip_inv_send_msg (inv, tdata); status = pjsip_inv_send_msg (inv, tdata);
if (status != PJ_SUCCESS) { if (status != PJ_SUCCESS) {
_debug(" SIPStartCall: failed to send invite\n");
return false; return false;
} }
...@@ -1632,6 +1633,8 @@ bool SIPVoIPLink::pjsip_init() ...@@ -1632,6 +1633,8 @@ bool SIPVoIPLink::pjsip_init()
_localExternAddress = Manager::instance().getFirewallAddress(); _localExternAddress = Manager::instance().getFirewallAddress();
_localExternPort = Manager::instance().getFirewallPort(); _localExternPort = Manager::instance().getFirewallPort();
} else { } else {
// Create a UDP listener meant for all accounts
// for which TLS was not enabled
_localExternAddress = _localIPAddress; _localExternAddress = _localIPAddress;
_localExternPort = _localPort; _localExternPort = _localPort;
errPjsip = createUDPServer(); errPjsip = createUDPServer();
...@@ -1639,7 +1642,7 @@ bool SIPVoIPLink::pjsip_init() ...@@ -1639,7 +1642,7 @@ bool SIPVoIPLink::pjsip_init()
// Create a UDP listener meant for all accounts // Create a UDP listener meant for all accounts
// for which TLS was not enabled // for which TLS was not enabled
errPjsip = createUDPServer(); // errPjsip = createUDPServer();
// If stun was not enabled an the above UDP server // If stun was not enabled an the above UDP server
// could not be created, then give it another try // could not be created, then give it another try
...@@ -1809,6 +1812,8 @@ int SIPVoIPLink::createUDPServer (void) ...@@ -1809,6 +1812,8 @@ int SIPVoIPLink::createUDPServer (void)
pjsip_host_port a_name; pjsip_host_port a_name;
char tmpIP[32]; char tmpIP[32];
_debug("Debug: createUDPServer called!\n");
// Init bound address to ANY // Init bound address to ANY
pj_memset (&bound_addr, 0, sizeof (bound_addr)); pj_memset (&bound_addr, 0, sizeof (bound_addr));
...@@ -2207,11 +2212,15 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e) ...@@ -2207,11 +2212,15 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e)
SIPCall * call = NULL; SIPCall * call = NULL;
call = reinterpret_cast<SIPCall*> (inv->mod_data[_mod_ua.id]); call = reinterpret_cast<SIPCall*> (inv->mod_data[_mod_ua.id]);
_debug(" call_on_state_changed: call id %s\n", call->getCallId().c_str());
if (call == NULL) { if (call == NULL) {
_debug("Call is NULL in call_on_state_changed"); _debug("Call is NULL in call_on_state_changed");
return; return;
} }
else
{
_debug(" call_on_state_changed: call id %s\n", call->getCallId().c_str());
_debug(" call_on_state_changed: call state %s\n", invitationStateMap[call->getInvSession()->state]);
}
//Retrieve the body message //Retrieve the body message
rdata = e->body.tsx_state.src.rdata; rdata = e->body.tsx_state.src.rdata;
...@@ -2239,6 +2248,7 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e) ...@@ -2239,6 +2248,7 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e)
pjsip_evsub_state ev_state = PJSIP_EVSUB_STATE_ACTIVE; pjsip_evsub_state ev_state = PJSIP_EVSUB_STATE_ACTIVE;
switch (call->getInvSession()->state) { switch (call->getInvSession()->state) {
// switch (inv->state) {
case PJSIP_INV_STATE_NULL: case PJSIP_INV_STATE_NULL:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment