From af89e40938bd8fade589d17be9354e32fec858ca Mon Sep 17 00:00:00 2001 From: Nenad Corbic Date: Thu, 15 Apr 2010 19:50:24 -0400 Subject: [PATCH 01/12] Bug fixes in freetdm and openzap --- .../ftmod_sangoma_boost/ftmod_sangoma_boost.c | 111 +++++++++++------- .../ozmod_sangoma_boost/ozmod_sangoma_boost.c | 56 ++++++--- 2 files changed, 109 insertions(+), 58 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.c b/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.c index f7f1aac7ad..89d6de354d 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.c @@ -70,15 +70,14 @@ static ftdm_status_t ftdm_sangoma_boost_list_sigmods(ftdm_stream_handle_t *strea #define BOOST_CHAN(ftdmchan) ((ftdm_sangoma_boost_data_t*)(ftdmchan)->span->signal_data)->sigmod ? ftdmchan->physical_chan_id : ftdmchan->physical_chan_id-1 /** - * \brief Strange flag + * \brief SANGOMA boost notification flag */ typedef enum { - SFLAG_FREE_REQ_ID = (1 << 0), - SFLAG_SENT_FINAL_MSG = (1 << 1), - SFLAG_SENT_ACK = (1 << 2), - SFLAG_RECVD_ACK = (1 << 3), - SFLAG_HANGUP = (1 << 4), - SFLAG_TERMINATING = (1 << 5) + SFLAG_SENT_FINAL_MSG = (1 << 0), + SFLAG_SENT_ACK = (1 << 1), + SFLAG_RECVD_ACK = (1 << 2), + SFLAG_HANGUP = (1 << 3), + SFLAG_TERMINATING = (1 << 4) } sflag_t; typedef uint16_t sangoma_boost_request_id_t; @@ -211,17 +210,20 @@ static sangoma_boost_request_id_t __next_request_id(const char *func, int line) static void print_request_ids(void) { sangoma_boost_request_id_t i = 0; - + int cnt=0; + ftdm_mutex_lock(request_mutex); for (i=1; i<= MAX_REQ_ID; i++){ if (req_map[i]) { ftdm_log(FTDM_LOG_CRIT, "Used Request ID=%i\n",i); + cnt++; } } ftdm_mutex_unlock(request_mutex); - + ftdm_log(FTDM_LOG_CRIT, "Total Request IDs=%i\n",cnt); + return; } @@ -623,9 +625,6 @@ static void handle_call_start_ack(sangomabc_connection_t *mcon, sangomabc_short_ event_chan = event->chan; } - OUTBOUND_REQUESTS[event->call_setup_id].event = *event; - SETUP_GRID[event->span][event->chan] = event->call_setup_id; - if (mcon->sigmod) { ftdmchan = OUTBOUND_REQUESTS[event->call_setup_id].ftdmchan; } else { @@ -638,6 +637,12 @@ static void handle_call_start_ack(sangomabc_connection_t *mcon, sangomabc_short_ if (ftdm_channel_open_chan(ftdmchan) != FTDM_SUCCESS) { ftdm_log(FTDM_LOG_ERROR, "Failed to open FTDM channel [%s]\n", ftdmchan->last_error); } else { + + /* Only bind the setup id to GRID when we are sure that channel is ready + otherwise we could overwite the original call */ + OUTBOUND_REQUESTS[event->call_setup_id].event = *event; + SETUP_GRID[event->span][event->chan] = event->call_setup_id; + ftdm_set_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND); ftdm_set_flag_locked(ftdmchan, FTDM_CHANNEL_INUSE); ftdmchan->sflags = SFLAG_RECVD_ACK; @@ -676,6 +681,7 @@ static void handle_call_start_ack(sangomabc_connection_t *mcon, sangomabc_short_ OUTBOUND_REQUESTS[event->call_setup_id].status = BST_READY; return; } + } else { ftdm_assert(!mcon->sigmod, "CALL STOP ACK: Invalid Sigmod Path"); @@ -690,16 +696,16 @@ static void handle_call_start_ack(sangomabc_connection_t *mcon, sangomabc_short_ if (ftdmchan->state == FTDM_CHANNEL_STATE_UP || ftdmchan->state == FTDM_CHANNEL_STATE_PROGRESS_MEDIA || ftdmchan->state == FTDM_CHANNEL_STATE_PROGRESS) { - ftdm_log(FTDM_LOG_CRIT, "FTDM_CHAN STATE UP/PROG/PROG_MEDIA -> Changed to HANGUP %d:%d\n", event->span+1,event->chan+1); - ftdm_set_state_r(ftdmchan, FTDM_CHANNEL_STATE_HANGUP, 0, r); - - } else if (ftdm_test_sflag(ftdmchan, SFLAG_HANGUP)) { - /* Do nothing because outgoing STOP will generaate a stop ack */ - + ftdm_log(FTDM_LOG_CRIT, "ZCHAN CALL ACK STATE UP -> Changed to TERMINATING %d:%d\n", event->span+1,event->chan+1); + ftdm_set_state_r(ftdmchan, FTDM_CHANNEL_STATE_TERMINATING, 0, r); + } else if (ftdmchan->state == FTDM_CHANNEL_STATE_HANGUP || ftdm_test_sflag(ftdmchan, SFLAG_HANGUP)) { + ftdm_log(FTDM_LOG_CRIT, "ZCHAN CALL ACK STATE HANGUP -> Changed to HANGUP COMPLETE %d:%d\n", event->span+1,event->chan+1); + ftdm_set_state_r(ftdmchan, FTDM_CHANNEL_STATE_HANGUP_COMPLETE, 0, r); } else { - ftdm_log(FTDM_LOG_CRIT, "FTDM_CHAN STATE INVALID %s on IN CALL ACK %d:%d\n", ftdm_channel_state2str(ftdmchan->state),event->span+1,event->chan+1); - + ftdm_log(FTDM_LOG_CRIT, "ZCHAN STATE INVALID State %s on IN CALL ACK %d:%d\n", + ftdm_channel_state2str(ftdmchan->state),event->span+1,event->chan+1); } + ftdm_set_sflag(ftdmchan, SFLAG_SENT_FINAL_MSG); ftdmchan=NULL; } } @@ -755,7 +761,6 @@ static void handle_call_done(ftdm_span_t *span, sangomabc_connection_t *mcon, sa ftdm_set_state_r(ftdmchan, FTDM_CHANNEL_STATE_HANGUP_COMPLETE, 0, r); if (r) { - ftdm_set_sflag(ftdmchan, SFLAG_FREE_REQ_ID); ftdm_mutex_unlock(ftdmchan->mutex); return; } @@ -928,10 +933,6 @@ static void handle_call_stop(ftdm_span_t *span, sangomabc_connection_t *mcon, sa ftdmchan->caller_data.hangup_cause = event->release_cause; } - if (r) { - ftdm_set_sflag(ftdmchan, SFLAG_FREE_REQ_ID); - } - ftdm_mutex_unlock(ftdmchan->mutex); if (r) { @@ -1002,17 +1003,19 @@ static void handle_call_start(ftdm_span_t *span, sangomabc_connection_t *mcon, s /* NC: If we get CALL START and channel is in active state then we are completely out of sync with the other end. Treat CALL START as CALL STOP and hangup the current call. + The incoming call will also be NACKed. */ - if (ftdmchan->state == FTDM_CHANNEL_STATE_UP) { + if (ftdmchan->state == FTDM_CHANNEL_STATE_UP || + ftdmchan->state == FTDM_CHANNEL_STATE_PROGRESS_MEDIA || + ftdmchan->state == FTDM_CHANNEL_STATE_PROGRESS) { ftdm_log(FTDM_LOG_CRIT, "ZCHAN STATE UP -> Changed to TERMINATING %d:%d\n", event->span+1,event->chan+1); ftdm_set_state_r(ftdmchan, FTDM_CHANNEL_STATE_TERMINATING, 0, r); - } else if (ftdm_test_sflag(ftdmchan, SFLAG_HANGUP)) { + } else if (ftdmchan->state == FTDM_CHANNEL_STATE_HANGUP || ftdm_test_sflag(ftdmchan, SFLAG_HANGUP)) { ftdm_log(FTDM_LOG_CRIT, "ZCHAN STATE HANGUP -> Changed to HANGUP COMPLETE %d:%d\n", event->span+1,event->chan+1); ftdm_set_state_r(ftdmchan, FTDM_CHANNEL_STATE_HANGUP_COMPLETE, 0, r); } else { ftdm_log(FTDM_LOG_CRIT, "ZCHAN STATE INVALID %s on IN CALL %d:%d\n", ftdm_channel_state2str(ftdmchan->state),event->span+1,event->chan+1); - } ftdm_set_sflag(ftdmchan, SFLAG_SENT_FINAL_MSG); ftdmchan = NULL; @@ -1366,9 +1369,7 @@ static __inline__ void state_advance(ftdm_channel_t *ftdmchan) int call_stopped_ack_sent = 0; ftdm_sangoma_boost_data_t *sangoma_boost_data = ftdmchan->span->signal_data; - if (ftdm_test_sflag(ftdmchan, SFLAG_FREE_REQ_ID)) { - release_request_id_span_chan(ftdmchan->physical_span_id-1, ftdmchan->physical_chan_id-1); - } + release_request_id_span_chan(ftdmchan->physical_span_id-1, ftdmchan->physical_chan_id-1); if (!ftdm_test_sflag(ftdmchan, SFLAG_SENT_FINAL_MSG)) { ftdm_set_sflag_locked(ftdmchan, SFLAG_SENT_FINAL_MSG); @@ -1920,6 +1921,21 @@ static int sigmod_ss7box_isup_exec_cmd(ftdm_stream_handle_t *stream, char *cmd) } #endif +static void ftdm_cli_span_state_cmd(ftdm_span_t *span, char *state) +{ + int j; + int cnt=0; + for(j = 1; j <= span->chan_count; j++) { + if (span->channels[j]->state != FTDM_CHANNEL_STATE_DOWN) { + ftdm_channel_t *ftdmchan = span->channels[j]; + ftdm_log(FTDM_LOG_CRIT, "Channel %i s%dc%d State=%s\n", + j,ftdmchan->physical_span_id-1,ftdmchan->physical_chan_id-1,ftdm_channel_state2str(ftdmchan->state)); + cnt++; + } + } + ftdm_log(FTDM_LOG_CRIT, "Total Channel Cnt %i\n",cnt); +} + #define FTDM_BOOST_SYNTAX "list sigmods | " /** * \brief API function to kill or debug a sangoma_boost span @@ -1974,27 +1990,42 @@ static FIO_API_FUNCTION(ftdm_sangoma_boost_api) goto done; #endif #endif - } else if (!strcasecmp(argv[0], "restart")) { + + } else if (!strcasecmp(argv[0], "span")) { sangomabc_connection_t *pcon; ftdm_sangoma_boost_data_t *sangoma_boost_data; ftdm_span_t *span; + + if (argc <= 2) { + stream->write_function(stream, "-ERR invalid span usage: span \n"); + goto done; + } + int err = ftdm_span_find_by_name(argv[1], &span); if (FTDM_SUCCESS != err) { stream->write_function(stream, "-ERR failed to find span by name %s\n",argv[1]); goto done; } - - sangoma_boost_data = span->signal_data; - pcon = &sangoma_boost_data->pcon; - /* No need to set any span flags because + if (!strcasecmp(argv[2], "restart")) { + sangoma_boost_data = span->signal_data; + pcon = &sangoma_boost_data->pcon; + + /* No need to set any span flags because our RESTART will generate a RESTART from the sig daemon */ - sangomabc_exec_commandp(pcon, + sangomabc_exec_commandp(pcon, 0, 0, -1, SIGBOOST_EVENT_SYSTEM_RESTART, - 0); + 0); + } else if (!strcasecmp(argv[2], "state")) { + if (argc <= 3) { + stream->write_function(stream, "-ERR invalid span state: span state \n"); + goto done; + } + ftdm_cli_span_state_cmd(span,argv[3]); + } goto done; @@ -2004,7 +2035,7 @@ static FIO_API_FUNCTION(ftdm_sangoma_boost_api) if (sigmod_iface) { char *p = strchr(data, ' '); if (++p) { - char* mydup = ftdm_strdup(p); + char* mydup = strdup(p); if(sigmod_iface->exec_api == NULL) { stream->write_function(stream, "%s does not support api functions\n", sigmod_iface->name); goto done; @@ -2013,7 +2044,7 @@ static FIO_API_FUNCTION(ftdm_sangoma_boost_api) if (sigmod_iface->exec_api(stream, mydup) != FTDM_SUCCESS) { stream->write_function(stream, "-ERR:failed to execute command:%s\n", mydup); } - ftdm_safe_free(mydup); + free(mydup); } goto done; diff --git a/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c b/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c index 995d943552..96321e2bda 100644 --- a/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c +++ b/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c @@ -344,6 +344,7 @@ static ZIO_CHANNEL_REQUEST_FUNCTION(sangoma_boost_channel_request) if (sangomabc_connection_write(&sangoma_boost_data->mcon, &event) <= 0) { zap_log(ZAP_LOG_CRIT, "Failed to tx on ISUP socket [%s]\n", strerror(errno)); status = ZAP_FAIL; + OUTBOUND_REQUESTS[r].status = ZAP_FAIL; *zchan = NULL; goto done; } @@ -351,7 +352,7 @@ static ZIO_CHANNEL_REQUEST_FUNCTION(sangoma_boost_channel_request) while(zap_running() && OUTBOUND_REQUESTS[r].status == BST_WAITING) { zap_sleep(1); if (--sanity <= 0) { - status = ZAP_FAIL; + status = ZAP_FAIL; *zchan = NULL; goto done; } @@ -456,13 +457,18 @@ static void handle_call_start_ack(sangomabc_connection_t *mcon, sangomabc_short_ return; } - OUTBOUND_REQUESTS[event->call_setup_id].event = *event; - SETUP_GRID[event->span][event->chan] = event->call_setup_id; + if ((zchan = find_zchan(OUTBOUND_REQUESTS[event->call_setup_id].span, event, 0))) { if (zap_channel_open_chan(zchan) != ZAP_SUCCESS) { zap_log(ZAP_LOG_ERROR, "OPEN ERROR [%s]\n", zchan->last_error); } else { + + /* Only bind the setup id to GRID when we are sure that channel is ready + otherwise we could overwite the original call */ + OUTBOUND_REQUESTS[event->call_setup_id].event = *event; + SETUP_GRID[event->span][event->chan] = event->call_setup_id; + zap_set_flag(zchan, ZAP_CHANNEL_OUTBOUND); zap_set_flag_locked(zchan, ZAP_CHANNEL_INUSE); zchan->extra_id = event->call_setup_id; @@ -499,16 +505,20 @@ static void handle_call_start_ack(sangomabc_connection_t *mcon, sangomabc_short_ if (zchan->state == ZAP_CHANNEL_STATE_UP || zchan->state == ZAP_CHANNEL_STATE_PROGRESS_MEDIA || zchan->state == ZAP_CHANNEL_STATE_PROGRESS) { - zap_log(ZAP_LOG_CRIT, "ZCHAN STATE UP/PROG/PROG_MEDIA -> Changed to HANGUP %d:%d\n", event->span+1,event->chan+1); - zap_set_state_r(zchan, ZAP_CHANNEL_STATE_HANGUP, 0, r); + zap_log(ZAP_LOG_CRIT, "ZCHAN CALL ACK STATE %s -> Changed to HANGUP %d:%d\n", + zap_channel_state2str(zchan->state),event->span+1,event->chan+1); + zap_set_state_r(zchan, ZAP_CHANNEL_STATE_TERMINATING, 0, r); - } else if (zap_test_sflag(zchan, SFLAG_HANGUP)) { + } else if (zchan->state == ZAP_CHANNEL_STATE_HANGUP || zap_test_sflag(zchan, SFLAG_HANGUP)) { + zap_log(ZAP_LOG_CRIT, "ZCHAN CALL ACK STATE HANGUP -> Changed to HANGUP %d:%d\n", event->span+1,event->chan+1); + zap_set_state_r(zchan, ZAP_CHANNEL_STATE_HANGUP_COMPLETE, 0, r); /* Do nothing because outgoing STOP will generaate a stop ack */ } else { - zap_log(ZAP_LOG_CRIT, "ZCHAN STATE INVALID %s on IN CALL ACK %d:%d\n", zap_channel_state2str(zchan->state),event->span+1,event->chan+1); - + zap_log(ZAP_LOG_CRIT, "ZCHAN CALL ACK STATE INVALID %s s%dc%d\n", + zap_channel_state2str(zchan->state),event->span+1,event->chan+1); } + zap_set_sflag(zchan, SFLAG_SENT_FINAL_MSG); zchan=NULL; } } @@ -518,7 +528,10 @@ static void handle_call_start_ack(sangomabc_connection_t *mcon, sangomabc_short_ //printf("WTF BAD ACK2 %d:%d (%d:%d) CSid=%d xtra_id=%d out=%d state=%s\n", zchan->span_id, zchan->chan_id, event->span+1,event->chan+1, event->call_setup_id, zchan->extra_id, zap_test_flag(zchan, ZAP_CHANNEL_OUTBOUND), zap_channel_state2str(zchan->state)); } - zap_set_sflag(zchan, SFLAG_SENT_FINAL_MSG); + if (zchan) { + zap_set_sflag(zchan, SFLAG_SENT_FINAL_MSG); + } + zap_log(ZAP_LOG_CRIT, "START ACK CANT FIND A CHAN %d:%d\n", event->span+1,event->chan+1); sangomabc_exec_command(mcon, event->span, @@ -777,17 +790,24 @@ static void handle_call_start(zap_span_t *span, sangomabc_connection_t *mcon, sa then we are completely out of sync with the other end. Treat CALL START as CALL STOP and hangup the current call. */ - - if (zchan->state == ZAP_CHANNEL_STATE_UP) { - zap_log(ZAP_LOG_CRIT, "ZCHAN STATE UP -> Changed to TERMINATING %d:%d\n", event->span+1,event->chan+1); - zap_set_state_r(zchan, ZAP_CHANNEL_STATE_TERMINATING, 0, r); - } else if (zap_test_sflag(zchan, SFLAG_HANGUP)) { - zap_log(ZAP_LOG_CRIT, "ZCHAN STATE HANGUP -> Changed to HANGUP COMPLETE %d:%d\n", event->span+1,event->chan+1); - zap_set_state_r(zchan, ZAP_CHANNEL_STATE_HANGUP_COMPLETE, 0, r); - } else { - zap_log(ZAP_LOG_CRIT, "ZCHAN STATE INVALID %s on IN CALL %d:%d\n", zap_channel_state2str(zchan->state),event->span+1,event->chan+1); + if (zchan->state == ZAP_CHANNEL_STATE_UP || + zchan->state == ZAP_CHANNEL_STATE_PROGRESS_MEDIA || + zchan->state == ZAP_CHANNEL_STATE_PROGRESS) { + zap_log(ZAP_LOG_CRIT, "ZCHAN CALL STATE %s -> Changed to TERMINATING %d:%d\n", + zap_channel_state2str(zchan->state),event->span+1,event->chan+1); + zap_set_state_r(zchan, ZAP_CHANNEL_STATE_TERMINATING, 0, r); + + } else if (zchan->state == ZAP_CHANNEL_STATE_HANGUP || zap_test_sflag(zchan, SFLAG_HANGUP)) { + zap_log(ZAP_LOG_CRIT, "ZCHAN CALL STATE HANGUP -> Changed to HANGUP %d:%d\n", event->span+1,event->chan+1); + zap_set_state_r(zchan, ZAP_CHANNEL_STATE_HANGUP_COMPLETE, 0, r); + /* Do nothing because outgoing STOP will generaate a stop ack */ + + } else { + zap_log(ZAP_LOG_CRIT, "ZCHAN CALL ACK STATE INVALID %s s%dc%d\n", + zap_channel_state2str(zchan->state),event->span+1,event->chan+1); } + zap_set_sflag(zchan, SFLAG_SENT_FINAL_MSG); zchan=NULL; } From f1a76608e7db83f4f208d9d176ba7bc49da2ff4f Mon Sep 17 00:00:00 2001 From: Nenad Corbic Date: Fri, 16 Apr 2010 18:28:15 -0400 Subject: [PATCH 02/12] openzap bug fix- try to remove id on down every time --- .../src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c b/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c index 96321e2bda..c32878debd 100644 --- a/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c +++ b/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c @@ -1152,9 +1152,8 @@ static __inline__ void state_advance(zap_channel_t *zchan) switch (zchan->state) { case ZAP_CHANNEL_STATE_DOWN: { - if (zap_test_sflag(zchan, SFLAG_FREE_REQ_ID)) { - release_request_id_span_chan(zchan->physical_span_id-1, zchan->physical_chan_id-1); - } + /* Always try to clear the GRID */ + release_request_id_span_chan(zchan->physical_span_id-1, zchan->physical_chan_id-1); if (!zap_test_sflag(zchan, SFLAG_SENT_FINAL_MSG)) { zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_MSG); From a96c2fcbfb59ed24d48c6dec21ff61bd5174ea19 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 22 Apr 2010 15:30:55 -0500 Subject: [PATCH 03/12] always export 'export_vars' --- src/switch_ivr_originate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 2df902bcc4..27dd189600 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -1366,6 +1366,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess int argc; char *argv[256]; + switch_event_del_header(var_event, SWITCH_EXPORT_VARS_VARIABLE); + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, SWITCH_EXPORT_VARS_VARIABLE, export_vars); + if ((argc = switch_separate_string(cptmp, ',', argv, (sizeof(argv) / sizeof(argv[0]))))) { int x; From 8a91066d5a919f44140f6f14c7dd9dcc5da88ad8 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Thu, 22 Apr 2010 20:32:29 -0500 Subject: [PATCH 04/12] MODEVENT-63 vcproj changes - the rest waiting on tarball update --- Freeswitch.2008.express.sln | 44 ++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/Freeswitch.2008.express.sln b/Freeswitch.2008.express.sln index 5d298734c8..e621622630 100644 --- a/Freeswitch.2008.express.sln +++ b/Freeswitch.2008.express.sln @@ -613,6 +613,24 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_valet_parking", "src\mo {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download JSON", "libs\win32\Download JSON.2008.vcproj", "{B808178B-82F0-4CF4-A2B1-921939FA24D0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjson", "libs\win32\json\libjson.2008.vcproj", "{9778F1C0-09BC-4698-8EBC-BD982247209A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_curl", "src\mod\applications\mod_curl\mod_curl.2008.vcproj", "{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + {87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588} + {9778F1C0-09BC-4698-8EBC-BD982247209A} = {9778F1C0-09BC-4698-8EBC-BD982247209A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_json_cdr", "src\mod\event_handlers\mod_json_cdr\mod_json_cdr.2008.vcproj", "{EBE7452D-B3F7-4798-8EED-A0DDE2D738F5}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + {87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588} + {9778F1C0-09BC-4698-8EBC-BD982247209A} = {9778F1C0-09BC-4698-8EBC-BD982247209A} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -1602,7 +1620,6 @@ Global {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.All|Win32.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.All|x64.ActiveCfg = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Win32.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|x64.ActiveCfg = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|x64.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Win32.ActiveCfg = Release|Win32 @@ -2002,6 +2019,31 @@ Global {432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|Win32.Build.0 = Release|Win32 {432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|x64.ActiveCfg = Release|x64 {432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|x64.Build.0 = Release|x64 + {B808178B-82F0-4CF4-A2B1-921939FA24D0}.All|Win32.ActiveCfg = Release|Win32 + {B808178B-82F0-4CF4-A2B1-921939FA24D0}.All|x64.ActiveCfg = Release|Win32 + {B808178B-82F0-4CF4-A2B1-921939FA24D0}.Debug|Win32.ActiveCfg = Debug|Win32 + {B808178B-82F0-4CF4-A2B1-921939FA24D0}.Debug|Win32.Build.0 = Debug|Win32 + {B808178B-82F0-4CF4-A2B1-921939FA24D0}.Debug|x64.ActiveCfg = Debug|Win32 + {B808178B-82F0-4CF4-A2B1-921939FA24D0}.Release|Win32.ActiveCfg = Release|Win32 + {B808178B-82F0-4CF4-A2B1-921939FA24D0}.Release|x64.ActiveCfg = Release|Win32 + {9778F1C0-09BC-4698-8EBC-BD982247209A}.All|Win32.ActiveCfg = Release|Win32 + {9778F1C0-09BC-4698-8EBC-BD982247209A}.All|x64.ActiveCfg = Release|Win32 + {9778F1C0-09BC-4698-8EBC-BD982247209A}.Debug|Win32.ActiveCfg = Debug|Win32 + {9778F1C0-09BC-4698-8EBC-BD982247209A}.Debug|x64.ActiveCfg = Debug|Win32 + {9778F1C0-09BC-4698-8EBC-BD982247209A}.Release|Win32.ActiveCfg = Release|Win32 + {9778F1C0-09BC-4698-8EBC-BD982247209A}.Release|x64.ActiveCfg = Release|Win32 + {EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.All|Win32.ActiveCfg = Release|Win32 + {EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.All|x64.ActiveCfg = Release|Win32 + {EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Debug|Win32.ActiveCfg = Debug|Win32 + {EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Debug|x64.ActiveCfg = Debug|Win32 + {EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Release|Win32.ActiveCfg = Release|Win32 + {EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Release|x64.ActiveCfg = Release|Win32 + {EBE7452D-B3F7-4798-8EED-A0DDE2D738F5}.All|Win32.ActiveCfg = Release|Win32 + {EBE7452D-B3F7-4798-8EED-A0DDE2D738F5}.All|x64.ActiveCfg = Release|Win32 + {EBE7452D-B3F7-4798-8EED-A0DDE2D738F5}.Debug|Win32.ActiveCfg = Debug|Win32 + {EBE7452D-B3F7-4798-8EED-A0DDE2D738F5}.Debug|x64.ActiveCfg = Debug|Win32 + {EBE7452D-B3F7-4798-8EED-A0DDE2D738F5}.Release|Win32.ActiveCfg = Release|Win32 + {EBE7452D-B3F7-4798-8EED-A0DDE2D738F5}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 05e5667d16f7fba8c0a274b1de23f765c9c70905 Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 22 Apr 2010 23:26:33 -0500 Subject: [PATCH 05/12] MP4V-ES passthru for washibechi on IRC --- src/mod/codecs/mod_mp4v/Makefile | 2 + src/mod/codecs/mod_mp4v/mod_mp4v.c | 102 +++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 src/mod/codecs/mod_mp4v/Makefile create mode 100644 src/mod/codecs/mod_mp4v/mod_mp4v.c diff --git a/src/mod/codecs/mod_mp4v/Makefile b/src/mod/codecs/mod_mp4v/Makefile new file mode 100644 index 0000000000..2c35e6e98f --- /dev/null +++ b/src/mod/codecs/mod_mp4v/Makefile @@ -0,0 +1,2 @@ +BASE=../../../.. +include $(BASE)/build/modmake.rules diff --git a/src/mod/codecs/mod_mp4v/mod_mp4v.c b/src/mod/codecs/mod_mp4v/mod_mp4v.c new file mode 100644 index 0000000000..9500075de3 --- /dev/null +++ b/src/mod/codecs/mod_mp4v/mod_mp4v.c @@ -0,0 +1,102 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2010, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Anthony Minessale II + * + * + * mod_mp4v.c -- MP4V Signed Linear Codec + * + */ + +#include + +SWITCH_MODULE_LOAD_FUNCTION(mod_mp4v_load); +SWITCH_MODULE_DEFINITION(mod_mp4v, mod_mp4v_load, NULL, NULL); + +static switch_status_t switch_mp4v_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings) +{ + int encoding, decoding; + + encoding = (flags & SWITCH_CODEC_FLAG_ENCODE); + decoding = (flags & SWITCH_CODEC_FLAG_DECODE); + + if (!(encoding || decoding)) { + return SWITCH_STATUS_FALSE; + } else { + if (codec->fmtp_in) { + codec->fmtp_out = switch_core_strdup(codec->memory_pool, codec->fmtp_in); + } + return SWITCH_STATUS_SUCCESS; + } +} + +static switch_status_t switch_mp4v_encode(switch_codec_t *codec, + switch_codec_t *other_codec, + void *decoded_data, + uint32_t decoded_data_len, + uint32_t decoded_rate, void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate, + unsigned int *flag) +{ + return SWITCH_STATUS_FALSE; +} + +static switch_status_t switch_mp4v_decode(switch_codec_t *codec, + switch_codec_t *other_codec, + void *encoded_data, + uint32_t encoded_data_len, + uint32_t encoded_rate, void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate, + unsigned int *flag) +{ + return SWITCH_STATUS_FALSE; +} + +static switch_status_t switch_mp4v_destroy(switch_codec_t *codec) +{ + return SWITCH_STATUS_SUCCESS; +} + +SWITCH_MODULE_LOAD_FUNCTION(mod_mp4v_load) +{ + switch_codec_interface_t *codec_interface; + /* connect my internal structure to the blank pointer passed to me */ + *module_interface = switch_loadable_module_create_module_interface(pool, modname); + SWITCH_ADD_CODEC(codec_interface, "H.264 Video (passthru)"); + switch_core_codec_add_implementation(pool, codec_interface, + SWITCH_CODEC_TYPE_VIDEO, 99, "MP4V-ES", NULL, 90000, 90000, 0, + 0, 0, 0, 0, 1, 1, switch_mp4v_init, switch_mp4v_encode, switch_mp4v_decode, switch_mp4v_destroy); + /* indicate that the module should continue to be loaded */ + return SWITCH_STATUS_SUCCESS; +} + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ From 16ebeb0eb902ba91c14d94121cc109e5b720a451 Mon Sep 17 00:00:00 2001 From: cypromis Date: Fri, 23 Apr 2010 10:12:45 +0200 Subject: [PATCH 06/12] bumped spec file vrersion up to 1.0.7-trunk for trunk added skinny dialplan stuff to specfile --- freeswitch.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/freeswitch.spec b/freeswitch.spec index 7f4212b50b..3522c8c0d0 100644 --- a/freeswitch.spec +++ b/freeswitch.spec @@ -9,8 +9,8 @@ Name: freeswitch Summary: FreeSWITCH open source telephony platform License: MPL Group: Productivity/Telephony/Servers -Version: 1.0.4 -Release: 1 +Version: 1.0.7 +Release: trunk URL: http://www.freeswitch.org/ Packager: Michal Bielicki Vendor: http://www.freeswitch.org/ @@ -355,6 +355,7 @@ fi %dir %attr(0750, freeswitch, daemon) %{prefix}/conf %dir %attr(0750, freeswitch, daemon) %{prefix}/conf/autoload_configs %dir %attr(0750, freeswitch, daemon) %{prefix}/conf/dialplan +%dir %attr(0750, freeswitch, daemon) %{prefix}/conf/dialplan/skinny-patterns %dir %attr(0750, freeswitch, daemon) %{prefix}/conf/directory %dir %attr(0750, freeswitch, daemon) %{prefix}/conf/directory/default %dir %attr(0750, freeswitch, daemon) %{prefix}/conf/lang @@ -430,6 +431,7 @@ fi %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/dialplan/*.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/dialplan/default/*.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/dialplan/public/*.xml +%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/dialplan/skinny-patterns %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/directory/*.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/directory/default/* %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/ivr_menus/*.xml @@ -614,6 +616,9 @@ fi %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/lang/ru/dir/*.xml %changelog +* Fr Apr 23 2010 - michal.bielicki@seventhsignal.de +- bumped spec file vrersion up to 1.0.7-trunk for trunk +- added skinny dialplan stuff to specfile * Sun Mar 28 2010 - michal.bielicki@seventhsignal.de - added sangoma codec config file * Wed Dec 02 2009 - michal.bielicki@seventhsignal.de From 1668597833caecdaae6baad444a6f1ee08c4f213 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Fri, 23 Apr 2010 10:28:13 -0400 Subject: [PATCH 07/12] freetdm: add IN_LOOP state to the state 2 str macro --- libs/freetdm/src/include/ftdm_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/freetdm/src/include/ftdm_types.h b/libs/freetdm/src/include/ftdm_types.h index bf7720efd1..a4f4eda047 100644 --- a/libs/freetdm/src/include/ftdm_types.h +++ b/libs/freetdm/src/include/ftdm_types.h @@ -383,7 +383,8 @@ typedef enum { } ftdm_channel_state_t; #define CHANNEL_STATE_STRINGS "DOWN", "HOLD", "SUSPENDED", "DIALTONE", "COLLECT", \ "RING", "BUSY", "ATTN", "GENRING", "DIALING", "GET_CALLERID", "CALLWAITING", \ - "RESTART", "PROGRESS", "PROGRESS_MEDIA", "UP", "IDLE", "TERMINATING", "CANCEL", "HANGUP", "HANGUP_COMPLETE", "INVALID" + "RESTART", "PROGRESS", "PROGRESS_MEDIA", "UP", "IDLE", "TERMINATING", "CANCEL", \ + "HANGUP", "HANGUP_COMPLETE", "IN_LOOP", "INVALID" FTDM_STR2ENUM_P(ftdm_str2ftdm_channel_state, ftdm_channel_state2str, ftdm_channel_state_t) typedef enum { From cad7f7044232247e6afbe8f269b9c6af0c05cda0 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Fri, 23 Apr 2010 10:37:06 -0400 Subject: [PATCH 08/12] freetdm: handle_call_done must be called on call start nack ack when there is no call setup id --- .../ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.c b/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.c index a45c5189d3..fb061f44f7 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_boost/ftmod_sangoma_boost.c @@ -1312,6 +1312,8 @@ static int parse_sangoma_event(ftdm_span_t *span, sangomabc_connection_t *mcon, if (event->call_setup_id) { nack_map[event->call_setup_id] = 0; release_request_id(event->call_setup_id); + } else { + handle_call_done(span, mcon, event); } break; case SIGBOOST_EVENT_INSERT_CHECK_LOOP: @@ -1923,11 +1925,15 @@ static void ftdm_cli_span_state_cmd(ftdm_span_t *span, char *state) { unsigned j; int cnt=0; + ftdm_channel_state_t state_e = ftdm_str2ftdm_channel_state(state); + if (state_e == FTDM_CHANNEL_STATE_INVALID) { + ftdm_log(FTDM_LOG_CRIT, "Checking for channels not in the INVALID state is probably not waht you want\n"); + } for(j = 1; j <= span->chan_count; j++) { - if (span->channels[j]->state != FTDM_CHANNEL_STATE_DOWN) { + if (span->channels[j]->state != state_e) { ftdm_channel_t *ftdmchan = span->channels[j]; ftdm_log(FTDM_LOG_CRIT, "Channel %i s%dc%d State=%s\n", - j,ftdmchan->physical_span_id-1,ftdmchan->physical_chan_id-1,ftdm_channel_state2str(ftdmchan->state)); + j, ftdmchan->physical_span_id-1, ftdmchan->physical_chan_id-1, ftdm_channel_state2str(ftdmchan->state)); cnt++; } } From 6d80b3db1167da127437f7164b2e78affd81cac5 Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 23 Apr 2010 10:22:54 -0500 Subject: [PATCH 09/12] swigall --- .../languages/mod_managed/freeswitch_wrap.cxx | 189 ++++++++++++++++- src/mod/languages/mod_managed/managed/swig.cs | 195 +++++++++++++++++- 2 files changed, 374 insertions(+), 10 deletions(-) diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index 49fb617ef6..df84f3ae43 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -3244,6 +3244,140 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_rtp_hdr_t(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtcp_hdr_t_version_set(void * jarg1, unsigned int jarg2) { + switch_rtcp_hdr_t *arg1 = (switch_rtcp_hdr_t *) 0 ; + unsigned int arg2 ; + + arg1 = (switch_rtcp_hdr_t *)jarg1; + arg2 = (unsigned int)jarg2; + if (arg1) (arg1)->version = arg2; + +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_switch_rtcp_hdr_t_version_get(void * jarg1) { + unsigned int jresult ; + switch_rtcp_hdr_t *arg1 = (switch_rtcp_hdr_t *) 0 ; + unsigned int result; + + arg1 = (switch_rtcp_hdr_t *)jarg1; + result = (unsigned int) ((arg1)->version); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtcp_hdr_t_p_set(void * jarg1, unsigned int jarg2) { + switch_rtcp_hdr_t *arg1 = (switch_rtcp_hdr_t *) 0 ; + unsigned int arg2 ; + + arg1 = (switch_rtcp_hdr_t *)jarg1; + arg2 = (unsigned int)jarg2; + if (arg1) (arg1)->p = arg2; + +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_switch_rtcp_hdr_t_p_get(void * jarg1) { + unsigned int jresult ; + switch_rtcp_hdr_t *arg1 = (switch_rtcp_hdr_t *) 0 ; + unsigned int result; + + arg1 = (switch_rtcp_hdr_t *)jarg1; + result = (unsigned int) ((arg1)->p); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtcp_hdr_t_count_set(void * jarg1, unsigned int jarg2) { + switch_rtcp_hdr_t *arg1 = (switch_rtcp_hdr_t *) 0 ; + unsigned int arg2 ; + + arg1 = (switch_rtcp_hdr_t *)jarg1; + arg2 = (unsigned int)jarg2; + if (arg1) (arg1)->count = arg2; + +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_switch_rtcp_hdr_t_count_get(void * jarg1) { + unsigned int jresult ; + switch_rtcp_hdr_t *arg1 = (switch_rtcp_hdr_t *) 0 ; + unsigned int result; + + arg1 = (switch_rtcp_hdr_t *)jarg1; + result = (unsigned int) ((arg1)->count); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtcp_hdr_t_type_set(void * jarg1, unsigned int jarg2) { + switch_rtcp_hdr_t *arg1 = (switch_rtcp_hdr_t *) 0 ; + unsigned int arg2 ; + + arg1 = (switch_rtcp_hdr_t *)jarg1; + arg2 = (unsigned int)jarg2; + if (arg1) (arg1)->type = arg2; + +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_switch_rtcp_hdr_t_type_get(void * jarg1) { + unsigned int jresult ; + switch_rtcp_hdr_t *arg1 = (switch_rtcp_hdr_t *) 0 ; + unsigned int result; + + arg1 = (switch_rtcp_hdr_t *)jarg1; + result = (unsigned int) ((arg1)->type); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtcp_hdr_t_length_set(void * jarg1, unsigned int jarg2) { + switch_rtcp_hdr_t *arg1 = (switch_rtcp_hdr_t *) 0 ; + unsigned int arg2 ; + + arg1 = (switch_rtcp_hdr_t *)jarg1; + arg2 = (unsigned int)jarg2; + if (arg1) (arg1)->length = arg2; + +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_switch_rtcp_hdr_t_length_get(void * jarg1) { + unsigned int jresult ; + switch_rtcp_hdr_t *arg1 = (switch_rtcp_hdr_t *) 0 ; + unsigned int result; + + arg1 = (switch_rtcp_hdr_t *)jarg1; + result = (unsigned int) ((arg1)->length); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_rtcp_hdr_t() { + void * jresult ; + switch_rtcp_hdr_t *result = 0 ; + + result = (switch_rtcp_hdr_t *)new switch_rtcp_hdr_t(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_rtcp_hdr_t(void * jarg1) { + switch_rtcp_hdr_t *arg1 = (switch_rtcp_hdr_t *) 0 ; + + arg1 = (switch_rtcp_hdr_t *)jarg1; + delete arg1; + +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38MaxBitRate_set(void * jarg1, unsigned long jarg2) { switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ; uint32_t arg2 ; @@ -25900,6 +26034,17 @@ SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_MAX_BUF_LEN_get() { } +SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTCP_MAX_BUF_LEN_get() { + int jresult ; + int result; + + result = (int) 16384; + + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_MAX_CRYPTO_LEN_get() { int jresult ; int result; @@ -26288,21 +26433,23 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_rtp_new(char * jarg1, unsigned short } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_set_remote_address(void * jarg1, char * jarg2, unsigned short jarg3, int jarg4, void * jarg5) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_set_remote_address(void * jarg1, char * jarg2, unsigned short jarg3, unsigned short jarg4, int jarg5, void * jarg6) { int jresult ; switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; char *arg2 = (char *) 0 ; switch_port_t arg3 ; - switch_bool_t arg4 ; - char **arg5 = (char **) 0 ; + switch_port_t arg4 ; + switch_bool_t arg5 ; + char **arg6 = (char **) 0 ; switch_status_t result; arg1 = (switch_rtp_t *)jarg1; arg2 = (char *)jarg2; arg3 = (switch_port_t)jarg3; - arg4 = (switch_bool_t)jarg4; - arg5 = (char **)jarg5; - result = (switch_status_t)switch_rtp_set_remote_address(arg1,(char const *)arg2,arg3,arg4,(char const **)arg5); + arg4 = (switch_port_t)jarg4; + arg5 = (switch_bool_t)jarg5; + arg6 = (char **)jarg6; + result = (switch_status_t)switch_rtp_set_remote_address(arg1,(char const *)arg2,arg3,arg4,arg5,(char const **)arg6); jresult = result; return jresult; } @@ -26420,6 +26567,22 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_ice(void * jarg1, char * j } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_rtcp(void * jarg1, int jarg2, unsigned short jarg3) { + int jresult ; + switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; + int arg2 ; + switch_port_t arg3 ; + switch_status_t result; + + arg1 = (switch_rtp_t *)jarg1; + arg2 = (int)jarg2; + arg3 = (switch_port_t)jarg3; + result = (switch_status_t)switch_rtp_activate_rtcp(arg1,arg2,arg3); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_jitter_buffer(void * jarg1, unsigned long jarg2) { int jresult ; switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; @@ -26638,6 +26801,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_zerocopy_read_frame(void * jarg1, v } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtcp_zerocopy_read_frame(void * jarg1, void * jarg2) { + int jresult ; + switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; + switch_rtcp_frame_t *arg2 = (switch_rtcp_frame_t *) 0 ; + switch_status_t result; + + arg1 = (switch_rtp_t *)jarg1; + arg2 = (switch_rtcp_frame_t *)jarg2; + result = (switch_status_t)switch_rtcp_zerocopy_read_frame(arg1,arg2); + jresult = result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_rtp_flush_read_buffer(void * jarg1, int jarg2) { switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; switch_rtp_flush_t arg2 ; diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index 1821bbb088..66be726ebd 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -4056,8 +4056,8 @@ public class freeswitch { return ret; } - public static switch_status_t switch_rtp_set_remote_address(SWIGTYPE_p_switch_rtp rtp_session, string host, ushort port, switch_bool_t change_adv_addr, ref string err) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_set_remote_address(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), host, port, (int)change_adv_addr, ref err); + public static switch_status_t switch_rtp_set_remote_address(SWIGTYPE_p_switch_rtp rtp_session, string host, ushort port, ushort remote_rtcp_port, switch_bool_t change_adv_addr, ref string err) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_set_remote_address(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), host, port, remote_rtcp_port, (int)change_adv_addr, ref err); return ret; } @@ -4106,6 +4106,11 @@ public class freeswitch { return ret; } + public static switch_status_t switch_rtp_activate_rtcp(SWIGTYPE_p_switch_rtp rtp_session, int send_rate, ushort remote_port) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_activate_rtcp(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), send_rate, remote_port); + return ret; + } + public static switch_status_t switch_rtp_activate_jitter_buffer(SWIGTYPE_p_switch_rtp rtp_session, uint queue_frames) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_activate_jitter_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), queue_frames); return ret; @@ -4183,6 +4188,11 @@ public class freeswitch { return ret; } + public static switch_status_t switch_rtcp_zerocopy_read_frame(SWIGTYPE_p_switch_rtp rtp_session, SWIGTYPE_p_switch_rtcp_frame frame) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtcp_zerocopy_read_frame(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), SWIGTYPE_p_switch_rtcp_frame.getCPtr(frame)); + return ret; + } + public static void rtp_flush_read_buffer(SWIGTYPE_p_switch_rtp rtp_session, switch_rtp_flush_t flush) { freeswitchPINVOKE.rtp_flush_read_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), (int)flush); } @@ -4914,6 +4924,7 @@ public class freeswitch { public static readonly int SWITCH_SMIN = freeswitchPINVOKE.SWITCH_SMIN_get(); public static readonly int SWITCH_RESAMPLE_QUALITY = freeswitchPINVOKE.SWITCH_RESAMPLE_QUALITY_get(); public static readonly int SWITCH_RTP_MAX_BUF_LEN = freeswitchPINVOKE.SWITCH_RTP_MAX_BUF_LEN_get(); + public static readonly int SWITCH_RTCP_MAX_BUF_LEN = freeswitchPINVOKE.SWITCH_RTCP_MAX_BUF_LEN_get(); public static readonly int SWITCH_RTP_MAX_CRYPTO_LEN = freeswitchPINVOKE.SWITCH_RTP_MAX_CRYPTO_LEN_get(); public static readonly int SWITCH_RTP_KEY_LEN = freeswitchPINVOKE.SWITCH_RTP_KEY_LEN_get(); public static readonly string SWITCH_RTP_CRYPTO_KEY_32 = freeswitchPINVOKE.SWITCH_RTP_CRYPTO_KEY_32_get(); @@ -5866,6 +5877,42 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_rtp_hdr_t")] public static extern void delete_switch_rtp_hdr_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_hdr_t_version_set")] + public static extern void switch_rtcp_hdr_t_version_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_hdr_t_version_get")] + public static extern uint switch_rtcp_hdr_t_version_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_hdr_t_p_set")] + public static extern void switch_rtcp_hdr_t_p_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_hdr_t_p_get")] + public static extern uint switch_rtcp_hdr_t_p_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_hdr_t_count_set")] + public static extern void switch_rtcp_hdr_t_count_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_hdr_t_count_get")] + public static extern uint switch_rtcp_hdr_t_count_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_hdr_t_type_set")] + public static extern void switch_rtcp_hdr_t_type_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_hdr_t_type_get")] + public static extern uint switch_rtcp_hdr_t_type_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_hdr_t_length_set")] + public static extern void switch_rtcp_hdr_t_length_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_hdr_t_length_get")] + public static extern uint switch_rtcp_hdr_t_length_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_rtcp_hdr_t")] + public static extern IntPtr new_switch_rtcp_hdr_t(); + + [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_rtcp_hdr_t")] + public static extern void delete_switch_rtcp_hdr_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38MaxBitRate_set")] public static extern void switch_t38_options_t_T38MaxBitRate_set(HandleRef jarg1, uint jarg2); @@ -11152,6 +11199,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_MAX_BUF_LEN_get")] public static extern int SWITCH_RTP_MAX_BUF_LEN_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTCP_MAX_BUF_LEN_get")] + public static extern int SWITCH_RTCP_MAX_BUF_LEN_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_MAX_CRYPTO_LEN_get")] public static extern int SWITCH_RTP_MAX_CRYPTO_LEN_get(); @@ -11240,7 +11290,7 @@ class freeswitchPINVOKE { public static extern IntPtr switch_rtp_new(string jarg1, ushort jarg2, string jarg3, ushort jarg4, byte jarg5, uint jarg6, uint jarg7, uint jarg8, string jarg9, ref string jarg10, HandleRef jarg11); [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_remote_address")] - public static extern int switch_rtp_set_remote_address(HandleRef jarg1, string jarg2, ushort jarg3, int jarg4, ref string jarg5); + public static extern int switch_rtp_set_remote_address(HandleRef jarg1, string jarg2, ushort jarg3, ushort jarg4, int jarg5, ref string jarg6); [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_get_remote_host")] public static extern string switch_rtp_get_remote_host(HandleRef jarg1); @@ -11272,6 +11322,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_activate_ice")] public static extern int switch_rtp_activate_ice(HandleRef jarg1, string jarg2, string jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_activate_rtcp")] + public static extern int switch_rtp_activate_rtcp(HandleRef jarg1, int jarg2, ushort jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_activate_jitter_buffer")] public static extern int switch_rtp_activate_jitter_buffer(HandleRef jarg1, uint jarg2); @@ -11320,6 +11373,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_zerocopy_read_frame")] public static extern int switch_rtp_zerocopy_read_frame(HandleRef jarg1, HandleRef jarg2, uint jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_zerocopy_read_frame")] + public static extern int switch_rtcp_zerocopy_read_frame(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_rtp_flush_read_buffer")] public static extern void rtp_flush_read_buffer(HandleRef jarg1, int jarg2); @@ -16855,6 +16911,36 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class SWIGTYPE_p_switch_rtcp_frame { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_switch_rtcp_frame(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_switch_rtcp_frame() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtcp_frame obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class SWIGTYPE_p_switch_rtp { private HandleRef swigCPtr; @@ -21473,6 +21559,7 @@ public enum switch_core_session_message_types_t { SWITCH_MESSAGE_INDICATE_PROXY_MEDIA, SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC, SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE, + SWITCH_MESSAGE_INDICATE_PHONE_EVENT, SWITCH_MESSAGE_INVALID } @@ -22861,6 +22948,7 @@ public enum switch_event_types_t { SWITCH_EVENT_SERVER_DISCONNECTED, SWITCH_EVENT_SEND_INFO, SWITCH_EVENT_RECV_INFO, + SWITCH_EVENT_RECV_RTCP_MESSAGE, SWITCH_EVENT_CALL_SECURE, SWITCH_EVENT_NAT, SWITCH_EVENT_RECORD_START, @@ -25770,6 +25858,103 @@ public enum switch_priority_t { namespace FreeSWITCH.Native { +using System; +using System.Runtime.InteropServices; + +public class switch_rtcp_hdr_t : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal switch_rtcp_hdr_t(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(switch_rtcp_hdr_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~switch_rtcp_hdr_t() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_switch_rtcp_hdr_t(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + GC.SuppressFinalize(this); + } + } + + public uint version { + set { + freeswitchPINVOKE.switch_rtcp_hdr_t_version_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_rtcp_hdr_t_version_get(swigCPtr); + return ret; + } + } + + public uint p { + set { + freeswitchPINVOKE.switch_rtcp_hdr_t_p_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_rtcp_hdr_t_p_get(swigCPtr); + return ret; + } + } + + public uint count { + set { + freeswitchPINVOKE.switch_rtcp_hdr_t_count_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_rtcp_hdr_t_count_get(swigCPtr); + return ret; + } + } + + public uint type { + set { + freeswitchPINVOKE.switch_rtcp_hdr_t_type_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_rtcp_hdr_t_type_get(swigCPtr); + return ret; + } + } + + public uint length { + set { + freeswitchPINVOKE.switch_rtcp_hdr_t_length_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_rtcp_hdr_t_length_get(swigCPtr); + return ret; + } + } + + public switch_rtcp_hdr_t() : this(freeswitchPINVOKE.new_switch_rtcp_hdr_t(), true) { + } + +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + public enum switch_rtp_bug_flag_t { RTP_BUG_NONE = 0, RTP_BUG_CISCO_SKIP_MARK_BIT_2833 = (1 << 0), @@ -25953,7 +26138,9 @@ namespace FreeSWITCH.Native { SWITCH_ZRTP_FLAG_SECURE_MITM_RECV = (1 << 26), SWITCH_RTP_FLAG_DEBUG_RTP_READ = (1 << 27), SWITCH_RTP_FLAG_DEBUG_RTP_WRITE = (1 << 28), - SWITCH_RTP_FLAG_VIDEO = (1 << 29) + SWITCH_RTP_FLAG_VIDEO = (1 << 29), + SWITCH_RTP_FLAG_ENABLE_RTCP = (1 << 30), + SWITCH_RTP_FLAG_RTCP_PASSTHRU = (1 << 31) } } From 8a4a09838cd70de1d0738607d18c2a43925e442d Mon Sep 17 00:00:00 2001 From: cseket Date: Fri, 23 Apr 2010 19:16:55 +0200 Subject: [PATCH 10/12] fix windows build (MODEVENT-63) --- .../event_handlers/mod_json_cdr/mod_json_cdr.2008.vcproj | 2 +- src/mod/event_handlers/mod_json_cdr/mod_json_cdr.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.2008.vcproj b/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.2008.vcproj index 1af8141191..d330aba5d8 100644 --- a/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.2008.vcproj +++ b/src/mod/event_handlers/mod_json_cdr/mod_json_cdr.2008.vcproj @@ -104,7 +104,7 @@ /> Date: Fri, 23 Apr 2010 12:14:37 -0500 Subject: [PATCH 11/12] add sanity check to launch threads that catch hangup and are not in a thread to make sure they clean up --- src/switch_channel.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/switch_channel.c b/src/switch_channel.c index 345d4e791a..acefec30dc 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -2108,6 +2108,11 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_channel_get_uuid(channel), SWITCH_LOG_NOTICE, "Hangup %s [%s] [%s]\n", channel->name, state_names[last_state], switch_channel_cause2str(channel->hangup_cause)); + + if (!switch_core_session_running(channel->session)) { + switch_core_session_thread_launch(channel->session); + } + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_HANGUP) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Hangup-Cause", switch_channel_cause2str(hangup_cause)); switch_channel_event_set_data(channel, event); From 5e4b0400dcc69974167349ba1f31298f17354817 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 23 Apr 2010 15:53:30 -0500 Subject: [PATCH 12/12] cleanup whitespace and add some logging --- src/mod/endpoints/mod_sofia/mod_sofia.c | 15 +++++++++++---- src/mod/endpoints/mod_sofia/sofia_glue.c | 14 +++++++++++++- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 1930454ebc..12a69d000d 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -160,22 +160,29 @@ static switch_status_t sofia_on_reset(switch_core_session_t *session) if (sofia_test_flag(tech_pvt, TFLAG_RECOVERING_BRIDGE)) { - switch_core_session_t *other_session; + switch_core_session_t *other_session = NULL; const char *uuid = switch_core_session_get_uuid(session); if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) { const char *other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE); + int x = 0; - if (other_uuid && (other_session = switch_core_session_locate(other_uuid))) { + if (other_uuid) { + for(x = 0; other_session == NULL && x < 5; x++) { + other_session = switch_core_session_locate(other_uuid); + switch_yield(100000); + } + } + + if (other_session) { switch_channel_t *other_channel = switch_core_session_get_channel(other_session); - switch_channel_clear_flag(channel, CF_BRIDGE_ORIGINATOR); switch_channel_wait_for_state_timeout(other_channel, CS_RESET, 5000); switch_channel_wait_for_flag(channel, CF_REQ_MEDIA, SWITCH_FALSE, 10000, NULL); switch_channel_wait_for_flag(channel, CF_MEDIA_ACK, SWITCH_TRUE, 10000, NULL); switch_channel_wait_for_flag(other_channel, CF_REQ_MEDIA, SWITCH_FALSE, 10000, NULL); switch_channel_wait_for_flag(other_channel, CF_MEDIA_ACK, SWITCH_TRUE, 10000, NULL); - + if (switch_channel_test_flag(channel, CF_PROXY_MODE) && switch_channel_test_flag(other_channel, CF_PROXY_MODE)) { switch_ivr_signal_bridge(session, other_session); } else { diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 77b82b0665..193001fe1f 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -3571,6 +3571,18 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t * match = 0; got_audio = 0; } + + for (map = m->m_rtpmaps; map; map = map->rm_next) { + if ((zstr(map->rm_encoding) || (tech_pvt->profile->ndlb & PFLAG_NDLB_ALLOW_BAD_IANANAME)) && map->rm_pt < 96) { + match = (map->rm_pt == tech_pvt->agreed_pt) ? 1 : 0; + } else { + match = strcasecmp(map->rm_encoding, tech_pvt->rm_encoding) ? 0 : 1; + } + } + + if (match) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Existing codec is already acceptable, using that.\n"); + } } for (map = m->m_rtpmaps; map; map = map->rm_next) { @@ -4247,7 +4259,7 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName } if ((tmp = switch_channel_get_variable(channel, "sip_use_pt"))) { - tech_pvt->agreed_pt = atoi(tmp); + tech_pvt->pt = tech_pvt->agreed_pt = atoi(tmp); } sofia_glue_tech_set_codec(tech_pvt, 1);