]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Merge branch 'netborder'
authorMoises Silva <moy@sangoma.com>
Mon, 28 Feb 2011 17:47:27 +0000 (12:47 -0500)
committerMoises Silva <moy@sangoma.com>
Mon, 28 Feb 2011 17:47:27 +0000 (12:47 -0500)
Conflicts:
libs/freetdm/mod_freetdm/mod_freetdm.c
libs/freetdm/src/ftdm_io.c
libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2_io_mf_lib.h
libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.c
libs/freetdm/src/include/freetdm.h
libs/freetdm/src/include/private/ftdm_core.h

1  2 
libs/freetdm/mod_freetdm/mod_freetdm.c
libs/freetdm/src/ftdm_io.c
libs/freetdm/src/ftdm_state.c
libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h
libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c
libs/freetdm/src/include/private/ftdm_core.h

index 4dc6cfcfd2f3619db871cad527c826840104a9a1,8e56a5b1e10a8fa0c8c80c3a6ffc904b5f28862c..a52abc0cec931b3b8fd4604fed73f851ef7e7922
@@@ -1579,16 -1573,14 +1573,14 @@@ ftdm_status_t ftdm_channel_from_event(f
                switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-Screen", "%d", channel_caller_data->screen);
                switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-Presentation", "%d", channel_caller_data->pres);
        }
-       if (channel_caller_data->raw_data_len) {
-               switch_channel_set_variable_printf(channel, "freetdm_custom_call_data", "%s", channel_caller_data->raw_data);
-       }
 -      
++
        /* Add any call variable to the dial plan */
-       iter = ftdm_call_get_var_iterator(channel_caller_data, iter);
+       iter = ftdm_sigmsg_get_var_iterator(sigmsg, iter);
        for (curr = iter ; curr; curr = ftdm_iterator_next(curr)) {
-               ftdm_call_get_current_var(curr, &var_name, &var_value);
+               ftdm_get_current_var(curr, &var_name, &var_value);
                snprintf(name, sizeof(name), FREETDM_VAR_PREFIX "%s", var_name);
                switch_channel_set_variable_printf(channel, name, "%s", var_value);
 -              switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Call Variable: %s=%s\n", name, var_value);
 +              switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Call Variable: %s = %s\n", name, var_value);
        }
        ftdm_iterator_free(iter);
        
index cd2c4850a4ca02f56b55295b1b7202339afc743d,765a3b343197348922e2c6c7ca57ad497ee7f579..ce345b2e28e9592c0387cdbf5a7dd80acb077fca
@@@ -2630,6 -2649,7 +2647,7 @@@ static ftdm_status_t ftdm_channel_done(
        ftdm_buffer_destroy(&ftdmchan->pre_buffer);
        ftdmchan->pre_buffer_size = 0;
        ftdm_mutex_unlock(ftdmchan->pre_buffer_mutex);
 -      
++
        if (ftdmchan->hangup_timer) {
                ftdm_sched_cancel_timer(globals.timingsched, ftdmchan->hangup_timer);
        }
Simple merge
index 0de52727da3253ed3996f6b92b13d7b4bc2bd1b9,464b1c02098c43a7138efab9e3f1535262f760ea..cd66afe9db61dc99b49e7e793cd1af8d1b69bac6
@@@ -624,27 -630,56 +629,55 @@@ FT_DECLARE(ftdm_status_t) ftdm_span_tri
  /*! \brief clear the tone detector state */
  FT_DECLARE(void) ftdm_channel_clear_detected_tones(ftdm_channel_t *ftdmchan);
  
- /* start/stop echo cancelling at the beginning/end of a call */
+ /*! \brief adjust echocanceller for beginning of call */
  FT_DECLARE(void) ftdm_set_echocancel_call_begin(ftdm_channel_t *chan);
+ /*! \brief adjust echocanceller for end of call */
  FT_DECLARE(void) ftdm_set_echocancel_call_end(ftdm_channel_t *chan);
  
- /*! \brief Clear all variables  attached to the call
-  *  \note Variables are cleared at the end of each call back, so it is not necessary for the user to call this function.
-  *  \todo Document which signaling variables are available
-  * */
- FT_DECLARE(ftdm_status_t) ftdm_call_clear_vars(ftdm_caller_data_t *caller_data);
 -
+ /*! \brief save data from user */
+ FT_DECLARE(ftdm_status_t) ftdm_channel_save_usrmsg(ftdm_channel_t *ftdmchan, ftdm_usrmsg_t *usrmsg);
  
- /*! \brief Remove a variable attached to the call
-  *  \note Removes a variable that was attached to the call.
-  *  \todo Document which call variables are available
-  * */
- FT_DECLARE(ftdm_status_t) ftdm_call_remove_var(ftdm_caller_data_t *caller_data, const char *var_name);
+ /*! \brief free usrmsg and variables/raw data attached to it */
+ FT_DECLARE(ftdm_status_t) ftdm_usrmsg_free(ftdm_usrmsg_t **usrmsg);
  
- /*! \brief Clears all the temporary data attached to this call
-  *  \note Clears caller_data->variables and caller_data->raw_data.
+ /*! \brief Get a custom variable from the user message
+  *  \note The variable pointer returned is only valid while the before the event is processed and it'll be destroyed once the event is processed. */
+ FT_DECLARE(const char *) ftdm_usrmsg_get_var(ftdm_usrmsg_t *usrmsg, const char *var_name);
+ /*! \brief Get raw data from user message
+  *  \param usrmsg The message structure containing the variables
+  *  \param data       data will point to available data pointer if available
+  *  \param datalen datalen will be set to length of data available
+  *  \retval FTDM_SUCCESS data is available
+  *  \retval FTDM_FAIL no data available
+  *  \note data is only valid within the duration of the callback, to receive a data pointer that does not get
+  *  \note destroyed when callback returns, see ftdm_sigmsg_get_raw_data_detached
+  */
+ FT_DECLARE(ftdm_status_t) ftdm_usrmsg_get_raw_data(ftdm_usrmsg_t *usrmsg, void **data, ftdm_size_t *datalen);
+ /*! \brief free sigmsg and variables/raw data attached to it */
+ FT_DECLARE(ftdm_status_t) ftdm_sigmsg_free(ftdm_sigmsg_t **sigmsg);
+ /*! \brief Add a custom variable to the event
+  *  \note This variables may be used by signaling modules to override signaling parameters
+  *  \todo Document which signaling variables are available
   * */
- FT_DECLARE(void) ftdm_call_clear_data(ftdm_caller_data_t *caller_data);
-               
+ FT_DECLARE(ftdm_status_t) ftdm_sigmsg_add_var(ftdm_sigmsg_t *sigmsg, const char *var_name, const char *value);
+ /*! \brief Remove a custom variable from the event
+  *  \note The variable pointer returned is only valid while the before the event is processed and it'll be destroyed once the event is processed. */
+ FT_DECLARE(ftdm_status_t) ftdm_sigmsg_remove_var(ftdm_sigmsg_t *sigmsg, const char *var_name);
+ /*! \brief Attach raw data to sigmsg
+  *  \param sigmsg The message structure containing the variables
+  *  \param data pointer to data
+  *  \param datalen datalen length of data
+  *  \retval FTDM_SUCCESS success, data was successfully saved
+  *  \retval FTDM_FAIL failed, event already had data attached to it.
+  *  \note data must have been allocated using ftdm_calloc, FreeTDM will free data once the usrmsg is processed.
+  */
+ FT_DECLARE(ftdm_status_t) ftdm_sigmsg_set_raw_data(ftdm_sigmsg_t *sigmsg, void *data, ftdm_size_t datalen);
  
  /*!
    \brief Assert condition