[asterisk-commits] mmichelson: trunk r395764 - in /trunk: channels/ configs/ include/asterisk/ r...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jul 30 13:14:53 CDT 2013
Author: mmichelson
Date: Tue Jul 30 13:14:50 2013
New Revision: 395764
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395764
Log:
The large GULP->PJSIP renaming effort.
The general gist is to have a clear boundary between old SIP stuff
and new SIP stuff by having the word "SIP" for old stuff and "PJSIP"
for new stuff. Here's a brief rundown of the changes:
* The word "Gulp" in dialstrings, functions, and CLI commands is now
"PJSIP"
* chan_gulp.c is now chan_pjsip.c
* Function names in chan_gulp.c that were "gulp_*" are now "chan_pjsip_*"
* All files that were "res_sip*" are now "res_pjsip*"
* The "res_sip" directory is now "res_pjsip"
* Files in the "res_pjsip" directory that began with "sip_*" are now "pjsip_*"
* The configuration file is now "pjsip.conf" instead of "res_sip.conf"
* The module info for all PJSIP-related files now uses "PJSIP" instead of "SIP"
* CLI and AMI commands created by Asterisk's PJSIP modules now have "pjsip" as
the starting word instead of "sip"
Added:
trunk/channels/chan_pjsip.c
- copied, changed from r395748, trunk/channels/chan_gulp.c
trunk/configs/pjsip.conf.sample
- copied unchanged from r395747, trunk/configs/res_sip.conf.sample
trunk/include/asterisk/res_pjsip.h
- copied unchanged from r395748, trunk/include/asterisk/res_sip.h
trunk/include/asterisk/res_pjsip_exten_state.h
- copied unchanged from r395747, trunk/include/asterisk/res_sip_exten_state.h
trunk/include/asterisk/res_pjsip_pubsub.h
- copied unchanged from r395747, trunk/include/asterisk/res_sip_pubsub.h
trunk/include/asterisk/res_pjsip_session.h
- copied unchanged from r395747, trunk/include/asterisk/res_sip_session.h
trunk/res/res_pjsip/
trunk/res/res_pjsip.c
- copied, changed from r395748, trunk/res/res_sip.c
trunk/res/res_pjsip.exports.in
- copied unchanged from r395748, trunk/res/res_sip.exports.in
trunk/res/res_pjsip/config_auth.c (with props)
trunk/res/res_pjsip/config_domain_aliases.c (with props)
trunk/res/res_pjsip/config_global.c (with props)
trunk/res/res_pjsip/config_security.c (with props)
trunk/res/res_pjsip/config_system.c (with props)
trunk/res/res_pjsip/config_transport.c (with props)
trunk/res/res_pjsip/include/
trunk/res/res_pjsip/include/res_pjsip_private.h (with props)
trunk/res/res_pjsip/location.c (with props)
trunk/res/res_pjsip/pjsip_configuration.c (with props)
trunk/res/res_pjsip/pjsip_distributor.c (with props)
trunk/res/res_pjsip/pjsip_global_headers.c (with props)
trunk/res/res_pjsip/pjsip_options.c (with props)
trunk/res/res_pjsip/pjsip_outbound_auth.c (with props)
trunk/res/res_pjsip/security_events.c (with props)
trunk/res/res_pjsip_acl.c
- copied, changed from r395747, trunk/res/res_sip_acl.c
trunk/res/res_pjsip_authenticator_digest.c
- copied, changed from r395748, trunk/res/res_sip_authenticator_digest.c
trunk/res/res_pjsip_caller_id.c
- copied, changed from r395748, trunk/res/res_sip_caller_id.c
trunk/res/res_pjsip_diversion.c
- copied, changed from r395748, trunk/res/res_sip_diversion.c
trunk/res/res_pjsip_dtmf_info.c
- copied, changed from r395747, trunk/res/res_sip_dtmf_info.c
trunk/res/res_pjsip_endpoint_identifier_anonymous.c
- copied, changed from r395747, trunk/res/res_sip_endpoint_identifier_anonymous.c
trunk/res/res_pjsip_endpoint_identifier_constant.c
- copied, changed from r395747, trunk/res/res_sip_endpoint_identifier_constant.c
trunk/res/res_pjsip_endpoint_identifier_ip.c
- copied, changed from r395747, trunk/res/res_sip_endpoint_identifier_ip.c
trunk/res/res_pjsip_endpoint_identifier_user.c
- copied, changed from r395747, trunk/res/res_sip_endpoint_identifier_user.c
trunk/res/res_pjsip_exten_state.c
- copied, changed from r395747, trunk/res/res_sip_exten_state.c
trunk/res/res_pjsip_exten_state.exports.in
- copied unchanged from r395747, trunk/res/res_sip_exten_state.exports.in
trunk/res/res_pjsip_logger.c
- copied, changed from r395747, trunk/res/res_sip_logger.c
trunk/res/res_pjsip_messaging.c
- copied, changed from r395748, trunk/res/res_sip_messaging.c
trunk/res/res_pjsip_mwi.c
- copied, changed from r395748, trunk/res/res_sip_mwi.c
trunk/res/res_pjsip_nat.c
- copied, changed from r395748, trunk/res/res_sip_nat.c
trunk/res/res_pjsip_notify.c
- copied, changed from r395747, trunk/res/res_sip_notify.c
trunk/res/res_pjsip_one_touch_record_info.c
- copied, changed from r395748, trunk/res/res_sip_one_touch_record_info.c
trunk/res/res_pjsip_outbound_authenticator_digest.c
- copied, changed from r395748, trunk/res/res_sip_outbound_authenticator_digest.c
trunk/res/res_pjsip_outbound_registration.c
- copied, changed from r395748, trunk/res/res_sip_outbound_registration.c
trunk/res/res_pjsip_pidf.c
- copied, changed from r395747, trunk/res/res_sip_pidf.c
trunk/res/res_pjsip_pubsub.c
- copied, changed from r395748, trunk/res/res_sip_pubsub.c
trunk/res/res_pjsip_pubsub.exports.in
- copied unchanged from r395747, trunk/res/res_sip_pubsub.exports.in
trunk/res/res_pjsip_refer.c
- copied, changed from r395747, trunk/res/res_sip_refer.c
trunk/res/res_pjsip_registrar.c
- copied, changed from r395747, trunk/res/res_sip_registrar.c
trunk/res/res_pjsip_registrar_expire.c
- copied, changed from r395747, trunk/res/res_sip_registrar_expire.c
trunk/res/res_pjsip_rfc3326.c
- copied, changed from r395747, trunk/res/res_sip_rfc3326.c
trunk/res/res_pjsip_sdp_rtp.c
- copied, changed from r395748, trunk/res/res_sip_sdp_rtp.c
trunk/res/res_pjsip_session.c
- copied, changed from r395748, trunk/res/res_sip_session.c
trunk/res/res_pjsip_session.exports.in
- copied unchanged from r395747, trunk/res/res_sip_session.exports.in
trunk/res/res_pjsip_t38.c
- copied, changed from r395748, trunk/res/res_sip_t38.c
trunk/res/res_pjsip_transport_websocket.c
- copied, changed from r395747, trunk/res/res_sip_transport_websocket.c
Removed:
trunk/channels/chan_gulp.c
trunk/configs/res_sip.conf.sample
trunk/include/asterisk/res_sip.h
trunk/include/asterisk/res_sip_exten_state.h
trunk/include/asterisk/res_sip_pubsub.h
trunk/include/asterisk/res_sip_session.h
trunk/res/res_sip/
trunk/res/res_sip.c
trunk/res/res_sip.exports.in
trunk/res/res_sip_acl.c
trunk/res/res_sip_authenticator_digest.c
trunk/res/res_sip_caller_id.c
trunk/res/res_sip_diversion.c
trunk/res/res_sip_dtmf_info.c
trunk/res/res_sip_endpoint_identifier_anonymous.c
trunk/res/res_sip_endpoint_identifier_constant.c
trunk/res/res_sip_endpoint_identifier_ip.c
trunk/res/res_sip_endpoint_identifier_user.c
trunk/res/res_sip_exten_state.c
trunk/res/res_sip_exten_state.exports.in
trunk/res/res_sip_logger.c
trunk/res/res_sip_messaging.c
trunk/res/res_sip_mwi.c
trunk/res/res_sip_nat.c
trunk/res/res_sip_notify.c
trunk/res/res_sip_one_touch_record_info.c
trunk/res/res_sip_outbound_authenticator_digest.c
trunk/res/res_sip_outbound_registration.c
trunk/res/res_sip_pidf.c
trunk/res/res_sip_pubsub.c
trunk/res/res_sip_pubsub.exports.in
trunk/res/res_sip_refer.c
trunk/res/res_sip_registrar.c
trunk/res/res_sip_registrar_expire.c
trunk/res/res_sip_rfc3326.c
trunk/res/res_sip_sdp_rtp.c
trunk/res/res_sip_session.c
trunk/res/res_sip_session.exports.in
trunk/res/res_sip_t38.c
trunk/res/res_sip_transport_websocket.c
Modified:
trunk/res/Makefile
Copied: trunk/channels/chan_pjsip.c (from r395748, trunk/channels/chan_gulp.c)
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_pjsip.c?view=diff&rev=395764&p1=trunk/channels/chan_gulp.c&r1=395748&p2=trunk/channels/chan_pjsip.c&r2=395764
==============================================================================
--- trunk/channels/chan_gulp.c (original)
+++ trunk/channels/chan_pjsip.c Tue Jul 30 13:14:50 2013
@@ -20,15 +20,15 @@
*
* \author Joshua Colp <jcolp at digium.com>
*
- * \brief Gulp SIP Channel Driver
+ * \brief PSJIP SIP Channel Driver
*
* \ingroup channel_drivers
*/
/*** MODULEINFO
<depend>pjproject</depend>
- <depend>res_sip</depend>
- <depend>res_sip_session</depend>
+ <depend>res_pjsip</depend>
+ <depend>res_pjsip_session</depend>
<support_level>core</support_level>
***/
@@ -58,11 +58,11 @@
#include "asterisk/stasis_channels.h"
#include "asterisk/indications.h"
-#include "asterisk/res_sip.h"
-#include "asterisk/res_sip_session.h"
+#include "asterisk/res_pjsip.h"
+#include "asterisk/res_pjsip_session.h"
/*** DOCUMENTATION
- <function name="GULP_DIAL_CONTACTS" language="en_US">
+ <function name="PJSIP_DIAL_CONTACTS" language="en_US">
<synopsis>
Return a dial string for dialing all contacts on an AOR.
</synopsis>
@@ -81,7 +81,7 @@
<para>Returns a properly formatted dial string for dialing all contacts on an AOR.</para>
</description>
</function>
- <function name="GULP_MEDIA_OFFER" language="en_US">
+ <function name="PJSIP_MEDIA_OFFER" language="en_US">
<synopsis>
Media and codec offerings to be set on an outbound SIP channel prior to dialing.
</synopsis>
@@ -96,8 +96,8 @@
</function>
***/
-static const char desc[] = "Gulp SIP Channel";
-static const char channel_type[] = "Gulp";
+static const char desc[] = "PJSIP Channel";
+static const char channel_type[] = "PJSIP";
static unsigned int chan_idx;
@@ -113,13 +113,13 @@
SIP_MEDIA_SIZE,
};
-struct gulp_pvt {
+struct chan_pjsip_pvt {
struct ast_sip_session_media *media[SIP_MEDIA_SIZE];
};
-static void gulp_pvt_dtor(void *obj)
-{
- struct gulp_pvt *pvt = obj;
+static void chan_pjsip_pvt_dtor(void *obj)
+{
+ struct chan_pjsip_pvt *pvt = obj;
int i;
for (i = 0; i < SIP_MEDIA_SIZE; ++i) {
@@ -129,70 +129,70 @@
}
/* \brief Asterisk core interaction functions */
-static struct ast_channel *gulp_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
-static int gulp_sendtext(struct ast_channel *ast, const char *text);
-static int gulp_digit_begin(struct ast_channel *ast, char digit);
-static int gulp_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
-static int gulp_call(struct ast_channel *ast, const char *dest, int timeout);
-static int gulp_hangup(struct ast_channel *ast);
-static int gulp_answer(struct ast_channel *ast);
-static struct ast_frame *gulp_read(struct ast_channel *ast);
-static int gulp_write(struct ast_channel *ast, struct ast_frame *f);
-static int gulp_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen);
-static int gulp_transfer(struct ast_channel *ast, const char *target);
-static int gulp_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
-static int gulp_devicestate(const char *data);
-static int gulp_queryoption(struct ast_channel *ast, int option, void *data, int *datalen);
+static struct ast_channel *chan_pjsip_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause);
+static int chan_pjsip_sendtext(struct ast_channel *ast, const char *text);
+static int chan_pjsip_digit_begin(struct ast_channel *ast, char digit);
+static int chan_pjsip_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
+static int chan_pjsip_call(struct ast_channel *ast, const char *dest, int timeout);
+static int chan_pjsip_hangup(struct ast_channel *ast);
+static int chan_pjsip_answer(struct ast_channel *ast);
+static struct ast_frame *chan_pjsip_read(struct ast_channel *ast);
+static int chan_pjsip_write(struct ast_channel *ast, struct ast_frame *f);
+static int chan_pjsip_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen);
+static int chan_pjsip_transfer(struct ast_channel *ast, const char *target);
+static int chan_pjsip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
+static int chan_pjsip_devicestate(const char *data);
+static int chan_pjsip_queryoption(struct ast_channel *ast, int option, void *data, int *datalen);
/*! \brief PBX interface structure for channel registration */
-static struct ast_channel_tech gulp_tech = {
+static struct ast_channel_tech chan_pjsip_tech = {
.type = channel_type,
- .description = "Gulp SIP Channel Driver",
- .requester = gulp_request,
- .send_text = gulp_sendtext,
- .send_digit_begin = gulp_digit_begin,
- .send_digit_end = gulp_digit_end,
- .call = gulp_call,
- .hangup = gulp_hangup,
- .answer = gulp_answer,
- .read = gulp_read,
- .write = gulp_write,
- .write_video = gulp_write,
- .exception = gulp_read,
- .indicate = gulp_indicate,
- .transfer = gulp_transfer,
- .fixup = gulp_fixup,
- .devicestate = gulp_devicestate,
- .queryoption = gulp_queryoption,
+ .description = "PJSIP Channel Driver",
+ .requester = chan_pjsip_request,
+ .send_text = chan_pjsip_sendtext,
+ .send_digit_begin = chan_pjsip_digit_begin,
+ .send_digit_end = chan_pjsip_digit_end,
+ .call = chan_pjsip_call,
+ .hangup = chan_pjsip_hangup,
+ .answer = chan_pjsip_answer,
+ .read = chan_pjsip_read,
+ .write = chan_pjsip_write,
+ .write_video = chan_pjsip_write,
+ .exception = chan_pjsip_read,
+ .indicate = chan_pjsip_indicate,
+ .transfer = chan_pjsip_transfer,
+ .fixup = chan_pjsip_fixup,
+ .devicestate = chan_pjsip_devicestate,
+ .queryoption = chan_pjsip_queryoption,
.properties = AST_CHAN_TP_WANTSJITTER | AST_CHAN_TP_CREATESJITTER
};
/*! \brief SIP session interaction functions */
-static void gulp_session_begin(struct ast_sip_session *session);
-static void gulp_session_end(struct ast_sip_session *session);
-static int gulp_incoming_request(struct ast_sip_session *session, struct pjsip_rx_data *rdata);
-static void gulp_incoming_response(struct ast_sip_session *session, struct pjsip_rx_data *rdata);
+static void chan_pjsip_session_begin(struct ast_sip_session *session);
+static void chan_pjsip_session_end(struct ast_sip_session *session);
+static int chan_pjsip_incoming_request(struct ast_sip_session *session, struct pjsip_rx_data *rdata);
+static void chan_pjsip_incoming_response(struct ast_sip_session *session, struct pjsip_rx_data *rdata);
/*! \brief SIP session supplement structure */
-static struct ast_sip_session_supplement gulp_supplement = {
+static struct ast_sip_session_supplement chan_pjsip_supplement = {
.method = "INVITE",
.priority = AST_SIP_SESSION_SUPPLEMENT_PRIORITY_CHANNEL,
- .session_begin = gulp_session_begin,
- .session_end = gulp_session_end,
- .incoming_request = gulp_incoming_request,
- .incoming_response = gulp_incoming_response,
+ .session_begin = chan_pjsip_session_begin,
+ .session_end = chan_pjsip_session_end,
+ .incoming_request = chan_pjsip_incoming_request,
+ .incoming_response = chan_pjsip_incoming_response,
};
-static int gulp_incoming_ack(struct ast_sip_session *session, struct pjsip_rx_data *rdata);
-
-static struct ast_sip_session_supplement gulp_ack_supplement = {
+static int chan_pjsip_incoming_ack(struct ast_sip_session *session, struct pjsip_rx_data *rdata);
+
+static struct ast_sip_session_supplement chan_pjsip_ack_supplement = {
.method = "ACK",
.priority = AST_SIP_SESSION_SUPPLEMENT_PRIORITY_CHANNEL,
- .incoming_request = gulp_incoming_ack,
+ .incoming_request = chan_pjsip_incoming_ack,
};
/*! \brief Dialplan function for constructing a dial string for calling all contacts */
-static int gulp_dial_contacts(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
+static int chan_pjsip_dial_contacts(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
RAII_VAR(struct ast_sip_endpoint *, endpoint, NULL, ao2_cleanup);
RAII_VAR(struct ast_str *, dial, NULL, ast_free_ptr);
@@ -247,7 +247,7 @@
it_contacts = ao2_iterator_init(contacts, 0);
for (; (contact = ao2_iterator_next(&it_contacts)); ao2_ref(contact, -1)) {
- ast_str_append(&dial, -1, "Gulp/");
+ ast_str_append(&dial, -1, "PJSIP/");
if (!ast_strlen_zero(args.request_user)) {
ast_str_append(&dial, -1, "%s@", args.request_user);
@@ -265,9 +265,9 @@
return 0;
}
-static struct ast_custom_function gulp_dial_contacts_function = {
- .name = "GULP_DIAL_CONTACTS",
- .read = gulp_dial_contacts,
+static struct ast_custom_function chan_pjsip_dial_contacts_function = {
+ .name = "PJSIP_DIAL_CONTACTS",
+ .read = chan_pjsip_dial_contacts,
};
static int media_offer_read_av(struct ast_sip_session *session, char *buf,
@@ -285,7 +285,7 @@
name = ast_getformatname(&fmt);
if (ast_strlen_zero(name)) {
- ast_log(LOG_WARNING, "GULP_MEDIA_OFFER unrecognized format %s\n", name);
+ ast_log(LOG_WARNING, "PJSIP_MEDIA_OFFER unrecognized format %s\n", name);
continue;
}
@@ -364,16 +364,16 @@
}
static struct ast_custom_function media_offer_function = {
- .name = "GULP_MEDIA_OFFER",
+ .name = "PJSIP_MEDIA_OFFER",
.read = media_offer_read,
.write = media_offer_write
};
/*! \brief Function called by RTP engine to get local audio RTP peer */
-static enum ast_rtp_glue_result gulp_get_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance **instance)
+static enum ast_rtp_glue_result chan_pjsip_get_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance **instance)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(chan);
- struct gulp_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt = channel->pvt;
struct ast_sip_endpoint *endpoint;
if (!pvt || !channel->session || !pvt->media[SIP_MEDIA_AUDIO]->rtp) {
@@ -398,10 +398,10 @@
}
/*! \brief Function called by RTP engine to get local video RTP peer */
-static enum ast_rtp_glue_result gulp_get_vrtp_peer(struct ast_channel *chan, struct ast_rtp_instance **instance)
+static enum ast_rtp_glue_result chan_pjsip_get_vrtp_peer(struct ast_channel *chan, struct ast_rtp_instance **instance)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(chan);
- struct gulp_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt = channel->pvt;
struct ast_sip_endpoint *endpoint;
if (!pvt || !channel->session || !pvt->media[SIP_MEDIA_VIDEO]->rtp) {
@@ -422,7 +422,7 @@
}
/*! \brief Function called by RTP engine to get peer capabilities */
-static void gulp_get_codec(struct ast_channel *chan, struct ast_format_cap *result)
+static void chan_pjsip_get_codec(struct ast_channel *chan, struct ast_format_cap *result)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(chan);
@@ -492,7 +492,7 @@
}
/*! \brief Function called by RTP engine to change where the remote party should send media */
-static int gulp_set_rtp_peer(struct ast_channel *chan,
+static int chan_pjsip_set_rtp_peer(struct ast_channel *chan,
struct ast_rtp_instance *rtp,
struct ast_rtp_instance *vrtp,
struct ast_rtp_instance *tpeer,
@@ -500,7 +500,7 @@
int nat_active)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(chan);
- struct gulp_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt = channel->pvt;
struct ast_sip_session *session = channel->session;
int changed = 0;
struct ast_channel *bridge_peer;
@@ -545,32 +545,32 @@
}
/*! \brief Local glue for interacting with the RTP engine core */
-static struct ast_rtp_glue gulp_rtp_glue = {
- .type = "Gulp",
- .get_rtp_info = gulp_get_rtp_peer,
- .get_vrtp_info = gulp_get_vrtp_peer,
- .get_codec = gulp_get_codec,
- .update_peer = gulp_set_rtp_peer,
+static struct ast_rtp_glue chan_pjsip_rtp_glue = {
+ .type = "PJSIP",
+ .get_rtp_info = chan_pjsip_get_rtp_peer,
+ .get_vrtp_info = chan_pjsip_get_vrtp_peer,
+ .get_codec = chan_pjsip_get_codec,
+ .update_peer = chan_pjsip_set_rtp_peer,
};
-/*! \brief Function called to create a new Gulp Asterisk channel */
-static struct ast_channel *gulp_new(struct ast_sip_session *session, int state, const char *exten, const char *title, const char *linkedid, const char *cid_name)
+/*! \brief Function called to create a new PJSIP Asterisk channel */
+static struct ast_channel *chan_pjsip_new(struct ast_sip_session *session, int state, const char *exten, const char *title, const char *linkedid, const char *cid_name)
{
struct ast_channel *chan;
struct ast_format fmt;
- RAII_VAR(struct gulp_pvt *, pvt, NULL, ao2_cleanup);
+ RAII_VAR(struct chan_pjsip_pvt *, pvt, NULL, ao2_cleanup);
struct ast_sip_channel_pvt *channel;
- if (!(pvt = ao2_alloc(sizeof(*pvt), gulp_pvt_dtor))) {
+ if (!(pvt = ao2_alloc(sizeof(*pvt), chan_pjsip_pvt_dtor))) {
return NULL;
}
- if (!(chan = ast_channel_alloc(1, state, S_OR(session->id.number.str, ""), S_OR(session->id.name.str, ""), "", "", "", linkedid, 0, "Gulp/%s-%08x", ast_sorcery_object_get_id(session->endpoint),
+ if (!(chan = ast_channel_alloc(1, state, S_OR(session->id.number.str, ""), S_OR(session->id.name.str, ""), "", "", "", linkedid, 0, "PJSIP/%s-%08x", ast_sorcery_object_get_id(session->endpoint),
ast_atomic_fetchadd_int((int *)&chan_idx, +1)))) {
return NULL;
}
- ast_channel_tech_set(chan, &gulp_tech);
+ ast_channel_tech_set(chan, &chan_pjsip_tech);
if (!(channel = ast_sip_channel_pvt_alloc(pvt, session))) {
ast_hangup(chan);
@@ -650,8 +650,8 @@
return (status == PJ_SUCCESS) ? 0 : -1;
}
-/*! \brief Function called by core when we should answer a Gulp session */
-static int gulp_answer(struct ast_channel *ast)
+/*! \brief Function called by core when we should answer a PJSIP session */
+static int chan_pjsip_answer(struct ast_channel *ast)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
@@ -672,7 +672,7 @@
}
/*! \brief Internal helper function called when CNG tone is detected */
-static struct ast_frame *gulp_cng_tone_detected(struct ast_sip_session *session, struct ast_frame *f)
+static struct ast_frame *chan_pjsip_cng_tone_detected(struct ast_sip_session *session, struct ast_frame *f)
{
const char *target_context;
int exists;
@@ -721,10 +721,10 @@
}
/*! \brief Function called by core to read any waiting frames */
-static struct ast_frame *gulp_read(struct ast_channel *ast)
+static struct ast_frame *chan_pjsip_read(struct ast_channel *ast)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
- struct gulp_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt = channel->pvt;
struct ast_frame *f;
struct ast_sip_session_media *media = NULL;
int rtcp = 0;
@@ -772,7 +772,7 @@
if (f && (f->frametype == AST_FRAME_DTMF)) {
if (f->subclass.integer == 'f') {
ast_debug(3, "Fax CNG detected on %s\n", ast_channel_name(ast));
- f = gulp_cng_tone_detected(channel->session, f);
+ f = chan_pjsip_cng_tone_detected(channel->session, f);
} else {
ast_debug(3, "* Detected inband DTMF '%c' on '%s'\n", f->subclass.integer,
ast_channel_name(ast));
@@ -784,10 +784,10 @@
}
/*! \brief Function called by core to write frames */
-static int gulp_write(struct ast_channel *ast, struct ast_frame *frame)
+static int chan_pjsip_write(struct ast_channel *ast, struct ast_frame *frame)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
- struct gulp_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt = channel->pvt;
struct ast_sip_session_media *media;
int res = 0;
@@ -821,7 +821,7 @@
case AST_FRAME_MODEM:
break;
default:
- ast_log(LOG_WARNING, "Can't send %d type frames with Gulp\n", frame->frametype);
+ ast_log(LOG_WARNING, "Can't send %d type frames with PJSIP\n", frame->frametype);
break;
}
@@ -837,7 +837,7 @@
{
struct fixup_data *fix_data = data;
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(fix_data->chan);
- struct gulp_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt = channel->pvt;
channel->session->channel = fix_data->chan;
if (pvt->media[SIP_MEDIA_AUDIO] && pvt->media[SIP_MEDIA_AUDIO]->rtp) {
@@ -851,7 +851,7 @@
}
/*! \brief Function called by core to change the underlying owner channel */
-static int gulp_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
+static int chan_pjsip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(newchan);
struct fixup_data fix_data;
@@ -872,7 +872,7 @@
}
/*! \brief Function called to get the device state of an endpoint */
-static int gulp_devicestate(const char *data)
+static int chan_pjsip_devicestate(const char *data)
{
RAII_VAR(struct ast_sip_endpoint *, endpoint, ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "endpoint", data), ao2_cleanup);
enum ast_device_state state = AST_DEVICE_UNKNOWN;
@@ -934,7 +934,7 @@
}
/*! \brief Function called to query options on a channel */
-static int gulp_queryoption(struct ast_channel *ast, int option, void *data, int *datalen)
+static int chan_pjsip_queryoption(struct ast_channel *ast, int option, void *data, int *datalen)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
struct ast_sip_session *session = channel->session;
@@ -1099,10 +1099,10 @@
}
/*! \brief Function called by core to ask the channel to indicate some sort of condition */
-static int gulp_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen)
+static int chan_pjsip_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
- struct gulp_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt = channel->pvt;
struct ast_sip_session_media *media;
int response_code = 0;
int res = 0;
@@ -1119,7 +1119,7 @@
} else {
res = -1;
}
- ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, "Gulp/%s", ast_sorcery_object_get_id(channel->session->endpoint));
+ ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, "PJSIP/%s", ast_sorcery_object_get_id(channel->session->endpoint));
break;
case AST_CONTROL_BUSY:
if (ast_channel_state(ast) != AST_STATE_UP) {
@@ -1335,7 +1335,7 @@
}
/*! \brief Function called by core for Asterisk initiated transfer */
-static int gulp_transfer(struct ast_channel *chan, const char *target)
+static int chan_pjsip_transfer(struct ast_channel *chan, const char *target)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(chan);
struct transfer_data *trnf_data = transfer_data_alloc(channel->session, target);
@@ -1354,10 +1354,10 @@
}
/*! \brief Function called by core to start a DTMF digit */
-static int gulp_digit_begin(struct ast_channel *chan, char digit)
+static int chan_pjsip_digit_begin(struct ast_channel *chan, char digit)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(chan);
- struct gulp_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt = channel->pvt;
struct ast_sip_session_media *media = pvt->media[SIP_MEDIA_AUDIO];
int res = 0;
@@ -1442,10 +1442,10 @@
}
/*! \brief Function called by core to stop a DTMF digit */
-static int gulp_digit_end(struct ast_channel *ast, char digit, unsigned int duration)
+static int chan_pjsip_digit_end(struct ast_channel *ast, char digit, unsigned int duration)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
- struct gulp_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt = channel->pvt;
struct ast_sip_session_media *media = pvt->media[SIP_MEDIA_AUDIO];
int res = 0;
@@ -1498,7 +1498,7 @@
}
/*! \brief Function called by core to actually start calling a remote party */
-static int gulp_call(struct ast_channel *ast, const char *dest, int timeout)
+static int chan_pjsip_call(struct ast_channel *ast, const char *dest, int timeout)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
@@ -1587,7 +1587,7 @@
}
/*! \brief Clear a channel from a session along with its PVT */
-static void clear_session_and_channel(struct ast_sip_session *session, struct ast_channel *ast, struct gulp_pvt *pvt)
+static void clear_session_and_channel(struct ast_sip_session *session, struct ast_channel *ast, struct chan_pjsip_pvt *pvt)
{
session->channel = NULL;
if (pvt->media[SIP_MEDIA_AUDIO] && pvt->media[SIP_MEDIA_AUDIO]->rtp) {
@@ -1606,7 +1606,7 @@
struct hangup_data *h_data = data;
struct ast_channel *ast = h_data->chan;
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
- struct gulp_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt = channel->pvt;
struct ast_sip_session *session = channel->session;
int cause = h_data->cause;
@@ -1626,11 +1626,11 @@
return 0;
}
-/*! \brief Function called by core to hang up a Gulp session */
-static int gulp_hangup(struct ast_channel *ast)
+/*! \brief Function called by core to hang up a PJSIP session */
+static int chan_pjsip_hangup(struct ast_channel *ast)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
- struct gulp_pvt *pvt = channel->pvt;
+ struct chan_pjsip_pvt *pvt = channel->pvt;
int cause = hangup_cause2sip(ast_channel_hangupcause(channel->session->channel));
struct hangup_data *h_data = hangup_data_alloc(cause, ast);
@@ -1676,7 +1676,7 @@
);
if (ast_strlen_zero(tmp)) {
- ast_log(LOG_ERROR, "Unable to create Gulp channel with empty destination\n");
+ ast_log(LOG_ERROR, "Unable to create PJSIP channel with empty destination\n");
req_data->cause = AST_CAUSE_CHANNEL_UNACCEPTABLE;
return -1;
}
@@ -1692,10 +1692,10 @@
}
if (ast_strlen_zero(endpoint_name)) {
- ast_log(LOG_ERROR, "Unable to create Gulp channel with empty endpoint name\n");
+ ast_log(LOG_ERROR, "Unable to create PJSIP channel with empty endpoint name\n");
req_data->cause = AST_CAUSE_CHANNEL_UNACCEPTABLE;
} else if (!(endpoint = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "endpoint", endpoint_name))) {
- ast_log(LOG_ERROR, "Unable to create Gulp channel - endpoint '%s' was not found\n", endpoint_name);
+ ast_log(LOG_ERROR, "Unable to create PJSIP channel - endpoint '%s' was not found\n", endpoint_name);
req_data->cause = AST_CAUSE_NO_ROUTE_DESTINATION;
return -1;
}
@@ -1710,8 +1710,8 @@
return 0;
}
-/*! \brief Function called by core to create a new outgoing Gulp session */
-static struct ast_channel *gulp_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
+/*! \brief Function called by core to create a new outgoing PJSIP session */
+static struct ast_channel *chan_pjsip_request(const char *type, struct ast_format_cap *cap, const struct ast_channel *requestor, const char *data, int *cause)
{
struct request_data req_data;
RAII_VAR(struct ast_sip_session *, session, NULL, ao2_cleanup);
@@ -1726,7 +1726,7 @@
session = req_data.session;
- if (!(session->channel = gulp_new(session, AST_STATE_DOWN, NULL, NULL, requestor ? ast_channel_linkedid(requestor) : NULL, NULL))) {
+ if (!(session->channel = chan_pjsip_new(session, AST_STATE_DOWN, NULL, NULL, requestor ? ast_channel_linkedid(requestor) : NULL, NULL))) {
/* Session needs to be terminated prematurely */
return NULL;
}
@@ -1784,8 +1784,8 @@
return 0;
}
-/*! \brief Function called by core to send text on Gulp session */
-static int gulp_sendtext(struct ast_channel *ast, const char *text)
+/*! \brief Function called by core to send text on PJSIP session */
+static int chan_pjsip_sendtext(struct ast_channel *ast, const char *text)
{
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
struct sendtext_data *data = sendtext_data_create(channel->session, text);
@@ -1888,7 +1888,7 @@
return 0;
}
-static void gulp_session_begin(struct ast_sip_session *session)
+static void chan_pjsip_session_begin(struct ast_sip_session *session)
{
RAII_VAR(struct ast_datastore *, datastore, NULL, ao2_cleanup);
@@ -1908,7 +1908,7 @@
}
/*! \brief Function called when the session ends */
-static void gulp_session_end(struct ast_sip_session *session)
+static void chan_pjsip_session_end(struct ast_sip_session *session)
{
if (!session->channel) {
return;
@@ -1924,7 +1924,7 @@
}
/*! \brief Function called when a request is received on the session */
-static int gulp_incoming_request(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
+static int chan_pjsip_incoming_request(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
{
pjsip_tx_data *packet = NULL;
@@ -1932,12 +1932,12 @@
return 0;
}
- if (!(session->channel = gulp_new(session, AST_STATE_RING, session->exten, NULL, NULL, NULL))) {
+ if (!(session->channel = chan_pjsip_new(session, AST_STATE_RING, session->exten, NULL, NULL, NULL))) {
if (pjsip_inv_end_session(session->inv_session, 503, NULL, &packet) == PJ_SUCCESS) {
ast_sip_session_send_response(session, packet);
}
- ast_log(LOG_ERROR, "Failed to allocate new GULP channel on incoming SIP INVITE\n");
+ ast_log(LOG_ERROR, "Failed to allocate new PJSIP channel on incoming SIP INVITE\n");
return -1;
}
/* channel gets created on incoming request, but we wait to call start
@@ -1967,7 +1967,7 @@
break;
}
- ast_debug(3, "Started PBX on new GULP channel %s\n", ast_channel_name(session->channel));
+ ast_debug(3, "Started PBX on new PJSIP channel %s\n", ast_channel_name(session->channel));
return (res == AST_PBX_SUCCESS) ? 0 : -1;
}
@@ -1979,7 +1979,7 @@
};
/*! \brief Function called when a response is received on the session */
-static void gulp_incoming_response(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
+static void chan_pjsip_incoming_response(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
{
struct pjsip_status_line status = rdata->msg_info.msg->line.status;
@@ -2005,7 +2005,7 @@
}
}
-static int gulp_incoming_ack(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
+static int chan_pjsip_incoming_ack(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
{
if (rdata->msg_info.msg->line.req.method.id == PJSIP_ACK_METHOD) {
if (session->endpoint->media.direct_media.enabled) {
@@ -2027,43 +2027,43 @@
*/
static int load_module(void)
{
- if (!(gulp_tech.capabilities = ast_format_cap_alloc())) {
+ if (!(chan_pjsip_tech.capabilities = ast_format_cap_alloc())) {
return AST_MODULE_LOAD_DECLINE;
}
- ast_format_cap_add_all_by_type(gulp_tech.capabilities, AST_FORMAT_TYPE_AUDIO);
-
- ast_rtp_glue_register(&gulp_rtp_glue);
-
- if (ast_channel_register(&gulp_tech)) {
+ ast_format_cap_add_all_by_type(chan_pjsip_tech.capabilities, AST_FORMAT_TYPE_AUDIO);
+
+ ast_rtp_glue_register(&chan_pjsip_rtp_glue);
+
+ if (ast_channel_register(&chan_pjsip_tech)) {
ast_log(LOG_ERROR, "Unable to register channel class %s\n", channel_type);
goto end;
}
- if (ast_custom_function_register(&gulp_dial_contacts_function)) {
- ast_log(LOG_ERROR, "Unable to register GULP_DIAL_CONTACTS dialplan function\n");
+ if (ast_custom_function_register(&chan_pjsip_dial_contacts_function)) {
+ ast_log(LOG_ERROR, "Unable to register PJSIP_DIAL_CONTACTS dialplan function\n");
goto end;
}
if (ast_custom_function_register(&media_offer_function)) {
- ast_log(LOG_WARNING, "Unable to register GULP_MEDIA_OFFER dialplan function\n");
- }
-
- if (ast_sip_session_register_supplement(&gulp_supplement)) {
- ast_log(LOG_ERROR, "Unable to register Gulp supplement\n");
+ ast_log(LOG_WARNING, "Unable to register PJSIP_MEDIA_OFFER dialplan function\n");
+ }
+
+ if (ast_sip_session_register_supplement(&chan_pjsip_supplement)) {
+ ast_log(LOG_ERROR, "Unable to register PJSIP supplement\n");
goto end;
}
if (ast_sip_session_register_supplement(&pbx_start_supplement)) {
- ast_log(LOG_ERROR, "Unable to register Gulp pbx start supplement\n");
- ast_sip_session_unregister_supplement(&gulp_supplement);
+ ast_log(LOG_ERROR, "Unable to register PJSIP pbx start supplement\n");
+ ast_sip_session_unregister_supplement(&chan_pjsip_supplement);
goto end;
}
- if (ast_sip_session_register_supplement(&gulp_ack_supplement)) {
- ast_log(LOG_ERROR, "Unable to register Gulp ACK supplement\n");
+ if (ast_sip_session_register_supplement(&chan_pjsip_ack_supplement)) {
+ ast_log(LOG_ERROR, "Unable to register PJSIP ACK supplement\n");
ast_sip_session_unregister_supplement(&pbx_start_supplement);
- ast_sip_session_unregister_supplement(&gulp_supplement);
+ ast_sip_session_unregister_supplement(&chan_pjsip_supplement);
goto end;
}
@@ -2071,9 +2071,9 @@
end:
ast_custom_function_unregister(&media_offer_function);
- ast_custom_function_unregister(&gulp_dial_contacts_function);
- ast_channel_unregister(&gulp_tech);
- ast_rtp_glue_unregister(&gulp_rtp_glue);
+ ast_custom_function_unregister(&chan_pjsip_dial_contacts_function);
+ ast_channel_unregister(&chan_pjsip_tech);
+ ast_rtp_glue_unregister(&chan_pjsip_rtp_glue);
return AST_MODULE_LOAD_FAILURE;
}
@@ -2084,22 +2084,22 @@
return -1;
}
-/*! \brief Unload the Gulp channel from Asterisk */
+/*! \brief Unload the PJSIP channel from Asterisk */
static int unload_module(void)
{
ast_custom_function_unregister(&media_offer_function);
- ast_sip_session_unregister_supplement(&gulp_supplement);
+ ast_sip_session_unregister_supplement(&chan_pjsip_supplement);
ast_sip_session_unregister_supplement(&pbx_start_supplement);
- ast_custom_function_unregister(&gulp_dial_contacts_function);
- ast_channel_unregister(&gulp_tech);
- ast_rtp_glue_unregister(&gulp_rtp_glue);
-
- return 0;
-}
-
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Gulp SIP Channel Driver",
+ ast_custom_function_unregister(&chan_pjsip_dial_contacts_function);
+ ast_channel_unregister(&chan_pjsip_tech);
+ ast_rtp_glue_unregister(&chan_pjsip_rtp_glue);
+
+ return 0;
+}
+
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Channel Driver",
.load = load_module,
.unload = unload_module,
.reload = reload,
Modified: trunk/res/Makefile
URL: http://svnview.digium.com/svn/asterisk/trunk/res/Makefile?view=diff&rev=395764&r1=395763&r2=395764
==============================================================================
--- trunk/res/Makefile (original)
+++ trunk/res/Makefile Tue Jul 30 13:14:50 2013
@@ -43,8 +43,8 @@
$(if $(filter res_ael_share,$(EMBEDDED_MODS)),modules.link,res_ael_share.so): ael/ael_lex.o ael/ael.tab.o ael/pval.o
ael/ael_lex.o ael/ael.tab.o ael/pval.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ael_share)
-$(if $(filter res_sip,$(EMBEDDED_MODS)),modules.link,res_sip.so): $(subst .c,.o,$(wildcard res_sip/*.c))
-$(subst .c,.o,$(wildcard res_sip/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_sip)
+$(if $(filter res_pjsip,$(EMBEDDED_MODS)),modules.link,res_pjsip.so): $(subst .c,.o,$(wildcard res_pjsip/*.c))
+$(subst .c,.o,$(wildcard res_pjsip/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_pjsip)
$(if $(filter res_stasis,$(EMBEDDED_MODS)),modules.link,res_stasis.so): $(subst .c,.o,$(wildcard stasis/*.c))
$(subst .c,.o,$(wildcard stasis/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_stasis)
@@ -74,7 +74,7 @@
clean::
rm -f snmp/*.[oi] ael/*.[oi] ais/*.[oi] ari/*.[oi]
- rm -f res_sip/*.[oi] stasis/*.[oi]
+ rm -f res_pjsip/*.[oi] stasis/*.[oi]
rm -f parking/*.o parking/*.i
$(if $(filter res_parking,$(EMBEDDED_MODS)),modules.link,res_parking.so): $(subst .c,.o,$(wildcard parking/*.c))
Copied: trunk/res/res_pjsip.c (from r395748, trunk/res/res_sip.c)
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip.c?view=diff&rev=395764&p1=trunk/res/res_sip.c&r1=395748&p2=trunk/res/res_pjsip.c&r2=395764
==============================================================================
--- trunk/res/res_sip.c (original)
+++ trunk/res/res_pjsip.c Tue Jul 30 13:14:50 2013
@@ -23,8 +23,8 @@
#include <pjsip_simple.h>
#include <pjlib.h>
-#include "asterisk/res_sip.h"
-#include "res_sip/include/res_sip_private.h"
[... 5329 lines stripped ...]
More information about the asterisk-commits
mailing list