mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
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" git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -20,15 +20,15 @@
|
|||||||
*
|
*
|
||||||
* \author Joshua Colp <jcolp@digium.com>
|
* \author Joshua Colp <jcolp@digium.com>
|
||||||
*
|
*
|
||||||
* \brief Gulp SIP Channel Driver
|
* \brief PSJIP SIP Channel Driver
|
||||||
*
|
*
|
||||||
* \ingroup channel_drivers
|
* \ingroup channel_drivers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_session</depend>
|
<depend>res_pjsip_session</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -58,11 +58,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
#include "asterisk/stasis_channels.h"
|
#include "asterisk/stasis_channels.h"
|
||||||
#include "asterisk/indications.h"
|
#include "asterisk/indications.h"
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
|
|
||||||
/*** DOCUMENTATION
|
/*** DOCUMENTATION
|
||||||
<function name="GULP_DIAL_CONTACTS" language="en_US">
|
<function name="PJSIP_DIAL_CONTACTS" language="en_US">
|
||||||
<synopsis>
|
<synopsis>
|
||||||
Return a dial string for dialing all contacts on an AOR.
|
Return a dial string for dialing all contacts on an AOR.
|
||||||
</synopsis>
|
</synopsis>
|
||||||
@@ -81,7 +81,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
<para>Returns a properly formatted dial string for dialing all contacts on an AOR.</para>
|
<para>Returns a properly formatted dial string for dialing all contacts on an AOR.</para>
|
||||||
</description>
|
</description>
|
||||||
</function>
|
</function>
|
||||||
<function name="GULP_MEDIA_OFFER" language="en_US">
|
<function name="PJSIP_MEDIA_OFFER" language="en_US">
|
||||||
<synopsis>
|
<synopsis>
|
||||||
Media and codec offerings to be set on an outbound SIP channel prior to dialing.
|
Media and codec offerings to be set on an outbound SIP channel prior to dialing.
|
||||||
</synopsis>
|
</synopsis>
|
||||||
@@ -96,8 +96,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
</function>
|
</function>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
static const char desc[] = "Gulp SIP Channel";
|
static const char desc[] = "PJSIP Channel";
|
||||||
static const char channel_type[] = "Gulp";
|
static const char channel_type[] = "PJSIP";
|
||||||
|
|
||||||
static unsigned int chan_idx;
|
static unsigned int chan_idx;
|
||||||
|
|
||||||
@@ -113,13 +113,13 @@ enum sip_session_media_position {
|
|||||||
SIP_MEDIA_SIZE,
|
SIP_MEDIA_SIZE,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct gulp_pvt {
|
struct chan_pjsip_pvt {
|
||||||
struct ast_sip_session_media *media[SIP_MEDIA_SIZE];
|
struct ast_sip_session_media *media[SIP_MEDIA_SIZE];
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gulp_pvt_dtor(void *obj)
|
static void chan_pjsip_pvt_dtor(void *obj)
|
||||||
{
|
{
|
||||||
struct gulp_pvt *pvt = obj;
|
struct chan_pjsip_pvt *pvt = obj;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < SIP_MEDIA_SIZE; ++i) {
|
for (i = 0; i < SIP_MEDIA_SIZE; ++i) {
|
||||||
@@ -129,70 +129,70 @@ static void gulp_pvt_dtor(void *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* \brief Asterisk core interaction functions */
|
/* \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 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 gulp_sendtext(struct ast_channel *ast, const char *text);
|
static int chan_pjsip_sendtext(struct ast_channel *ast, const char *text);
|
||||||
static int gulp_digit_begin(struct ast_channel *ast, char digit);
|
static int chan_pjsip_digit_begin(struct ast_channel *ast, char 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);
|
||||||
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);
|
||||||
static int gulp_hangup(struct ast_channel *ast);
|
static int chan_pjsip_hangup(struct ast_channel *ast);
|
||||||
static int gulp_answer(struct ast_channel *ast);
|
static int chan_pjsip_answer(struct ast_channel *ast);
|
||||||
static struct ast_frame *gulp_read(struct ast_channel *ast);
|
static struct ast_frame *chan_pjsip_read(struct ast_channel *ast);
|
||||||
static int gulp_write(struct ast_channel *ast, struct ast_frame *f);
|
static int chan_pjsip_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 chan_pjsip_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 chan_pjsip_transfer(struct ast_channel *ast, const char *target);
|
||||||
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);
|
||||||
static int gulp_devicestate(const char *data);
|
static int chan_pjsip_devicestate(const char *data);
|
||||||
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);
|
||||||
|
|
||||||
/*! \brief PBX interface structure for channel registration */
|
/*! \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,
|
.type = channel_type,
|
||||||
.description = "Gulp SIP Channel Driver",
|
.description = "PJSIP Channel Driver",
|
||||||
.requester = gulp_request,
|
.requester = chan_pjsip_request,
|
||||||
.send_text = gulp_sendtext,
|
.send_text = chan_pjsip_sendtext,
|
||||||
.send_digit_begin = gulp_digit_begin,
|
.send_digit_begin = chan_pjsip_digit_begin,
|
||||||
.send_digit_end = gulp_digit_end,
|
.send_digit_end = chan_pjsip_digit_end,
|
||||||
.call = gulp_call,
|
.call = chan_pjsip_call,
|
||||||
.hangup = gulp_hangup,
|
.hangup = chan_pjsip_hangup,
|
||||||
.answer = gulp_answer,
|
.answer = chan_pjsip_answer,
|
||||||
.read = gulp_read,
|
.read = chan_pjsip_read,
|
||||||
.write = gulp_write,
|
.write = chan_pjsip_write,
|
||||||
.write_video = gulp_write,
|
.write_video = chan_pjsip_write,
|
||||||
.exception = gulp_read,
|
.exception = chan_pjsip_read,
|
||||||
.indicate = gulp_indicate,
|
.indicate = chan_pjsip_indicate,
|
||||||
.transfer = gulp_transfer,
|
.transfer = chan_pjsip_transfer,
|
||||||
.fixup = gulp_fixup,
|
.fixup = chan_pjsip_fixup,
|
||||||
.devicestate = gulp_devicestate,
|
.devicestate = chan_pjsip_devicestate,
|
||||||
.queryoption = gulp_queryoption,
|
.queryoption = chan_pjsip_queryoption,
|
||||||
.properties = AST_CHAN_TP_WANTSJITTER | AST_CHAN_TP_CREATESJITTER
|
.properties = AST_CHAN_TP_WANTSJITTER | AST_CHAN_TP_CREATESJITTER
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! \brief SIP session interaction functions */
|
/*! \brief SIP session interaction functions */
|
||||||
static void gulp_session_begin(struct ast_sip_session *session);
|
static void chan_pjsip_session_begin(struct ast_sip_session *session);
|
||||||
static void gulp_session_end(struct ast_sip_session *session);
|
static void chan_pjsip_session_end(struct ast_sip_session *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);
|
||||||
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);
|
||||||
|
|
||||||
/*! \brief SIP session supplement structure */
|
/*! \brief SIP session supplement structure */
|
||||||
static struct ast_sip_session_supplement gulp_supplement = {
|
static struct ast_sip_session_supplement chan_pjsip_supplement = {
|
||||||
.method = "INVITE",
|
.method = "INVITE",
|
||||||
.priority = AST_SIP_SESSION_SUPPLEMENT_PRIORITY_CHANNEL,
|
.priority = AST_SIP_SESSION_SUPPLEMENT_PRIORITY_CHANNEL,
|
||||||
.session_begin = gulp_session_begin,
|
.session_begin = chan_pjsip_session_begin,
|
||||||
.session_end = gulp_session_end,
|
.session_end = chan_pjsip_session_end,
|
||||||
.incoming_request = gulp_incoming_request,
|
.incoming_request = chan_pjsip_incoming_request,
|
||||||
.incoming_response = gulp_incoming_response,
|
.incoming_response = chan_pjsip_incoming_response,
|
||||||
};
|
};
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
static struct ast_sip_session_supplement gulp_ack_supplement = {
|
static struct ast_sip_session_supplement chan_pjsip_ack_supplement = {
|
||||||
.method = "ACK",
|
.method = "ACK",
|
||||||
.priority = AST_SIP_SESSION_SUPPLEMENT_PRIORITY_CHANNEL,
|
.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 */
|
/*! \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_sip_endpoint *, endpoint, NULL, ao2_cleanup);
|
||||||
RAII_VAR(struct ast_str *, dial, NULL, ast_free_ptr);
|
RAII_VAR(struct ast_str *, dial, NULL, ast_free_ptr);
|
||||||
@@ -247,7 +247,7 @@ static int gulp_dial_contacts(struct ast_channel *chan, const char *cmd, char *d
|
|||||||
|
|
||||||
it_contacts = ao2_iterator_init(contacts, 0);
|
it_contacts = ao2_iterator_init(contacts, 0);
|
||||||
for (; (contact = ao2_iterator_next(&it_contacts)); ao2_ref(contact, -1)) {
|
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)) {
|
if (!ast_strlen_zero(args.request_user)) {
|
||||||
ast_str_append(&dial, -1, "%s@", args.request_user);
|
ast_str_append(&dial, -1, "%s@", args.request_user);
|
||||||
@@ -265,9 +265,9 @@ static int gulp_dial_contacts(struct ast_channel *chan, const char *cmd, char *d
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ast_custom_function gulp_dial_contacts_function = {
|
static struct ast_custom_function chan_pjsip_dial_contacts_function = {
|
||||||
.name = "GULP_DIAL_CONTACTS",
|
.name = "PJSIP_DIAL_CONTACTS",
|
||||||
.read = gulp_dial_contacts,
|
.read = chan_pjsip_dial_contacts,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int media_offer_read_av(struct ast_sip_session *session, char *buf,
|
static int media_offer_read_av(struct ast_sip_session *session, char *buf,
|
||||||
@@ -285,7 +285,7 @@ static int media_offer_read_av(struct ast_sip_session *session, char *buf,
|
|||||||
name = ast_getformatname(&fmt);
|
name = ast_getformatname(&fmt);
|
||||||
|
|
||||||
if (ast_strlen_zero(name)) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,16 +364,16 @@ static int media_offer_write(struct ast_channel *chan, const char *cmd, char *da
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct ast_custom_function media_offer_function = {
|
static struct ast_custom_function media_offer_function = {
|
||||||
.name = "GULP_MEDIA_OFFER",
|
.name = "PJSIP_MEDIA_OFFER",
|
||||||
.read = media_offer_read,
|
.read = media_offer_read,
|
||||||
.write = media_offer_write
|
.write = media_offer_write
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! \brief Function called by RTP engine to get local audio RTP peer */
|
/*! \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 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;
|
struct ast_sip_endpoint *endpoint;
|
||||||
|
|
||||||
if (!pvt || !channel->session || !pvt->media[SIP_MEDIA_AUDIO]->rtp) {
|
if (!pvt || !channel->session || !pvt->media[SIP_MEDIA_AUDIO]->rtp) {
|
||||||
@@ -398,10 +398,10 @@ static enum ast_rtp_glue_result gulp_get_rtp_peer(struct ast_channel *chan, stru
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by RTP engine to get local video RTP peer */
|
/*! \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 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;
|
struct ast_sip_endpoint *endpoint;
|
||||||
|
|
||||||
if (!pvt || !channel->session || !pvt->media[SIP_MEDIA_VIDEO]->rtp) {
|
if (!pvt || !channel->session || !pvt->media[SIP_MEDIA_VIDEO]->rtp) {
|
||||||
@@ -422,7 +422,7 @@ static enum ast_rtp_glue_result gulp_get_vrtp_peer(struct ast_channel *chan, str
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by RTP engine to get peer capabilities */
|
/*! \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);
|
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(chan);
|
||||||
|
|
||||||
@@ -492,7 +492,7 @@ static int check_for_rtp_changes(struct ast_channel *chan, struct ast_rtp_instan
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by RTP engine to change where the remote party should send media */
|
/*! \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 *rtp,
|
||||||
struct ast_rtp_instance *vrtp,
|
struct ast_rtp_instance *vrtp,
|
||||||
struct ast_rtp_instance *tpeer,
|
struct ast_rtp_instance *tpeer,
|
||||||
@@ -500,7 +500,7 @@ static int gulp_set_rtp_peer(struct ast_channel *chan,
|
|||||||
int nat_active)
|
int nat_active)
|
||||||
{
|
{
|
||||||
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(chan);
|
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;
|
struct ast_sip_session *session = channel->session;
|
||||||
int changed = 0;
|
int changed = 0;
|
||||||
struct ast_channel *bridge_peer;
|
struct ast_channel *bridge_peer;
|
||||||
@@ -545,32 +545,32 @@ static int gulp_set_rtp_peer(struct ast_channel *chan,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Local glue for interacting with the RTP engine core */
|
/*! \brief Local glue for interacting with the RTP engine core */
|
||||||
static struct ast_rtp_glue gulp_rtp_glue = {
|
static struct ast_rtp_glue chan_pjsip_rtp_glue = {
|
||||||
.type = "Gulp",
|
.type = "PJSIP",
|
||||||
.get_rtp_info = gulp_get_rtp_peer,
|
.get_rtp_info = chan_pjsip_get_rtp_peer,
|
||||||
.get_vrtp_info = gulp_get_vrtp_peer,
|
.get_vrtp_info = chan_pjsip_get_vrtp_peer,
|
||||||
.get_codec = gulp_get_codec,
|
.get_codec = chan_pjsip_get_codec,
|
||||||
.update_peer = gulp_set_rtp_peer,
|
.update_peer = chan_pjsip_set_rtp_peer,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! \brief Function called to create a new Gulp Asterisk channel */
|
/*! \brief Function called to create a new PJSIP 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)
|
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_channel *chan;
|
||||||
struct ast_format fmt;
|
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;
|
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;
|
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)))) {
|
ast_atomic_fetchadd_int((int *)&chan_idx, +1)))) {
|
||||||
return NULL;
|
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))) {
|
if (!(channel = ast_sip_channel_pvt_alloc(pvt, session))) {
|
||||||
ast_hangup(chan);
|
ast_hangup(chan);
|
||||||
@@ -650,8 +650,8 @@ static int answer(void *data)
|
|||||||
return (status == PJ_SUCCESS) ? 0 : -1;
|
return (status == PJ_SUCCESS) ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core when we should answer a Gulp session */
|
/*! \brief Function called by core when we should answer a PJSIP session */
|
||||||
static int gulp_answer(struct ast_channel *ast)
|
static int chan_pjsip_answer(struct ast_channel *ast)
|
||||||
{
|
{
|
||||||
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
|
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
|
||||||
|
|
||||||
@@ -672,7 +672,7 @@ static int gulp_answer(struct ast_channel *ast)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Internal helper function called when CNG tone is detected */
|
/*! \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;
|
const char *target_context;
|
||||||
int exists;
|
int exists;
|
||||||
@@ -721,10 +721,10 @@ static struct ast_frame *gulp_cng_tone_detected(struct ast_sip_session *session,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core to read any waiting frames */
|
/*! \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 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_frame *f;
|
||||||
struct ast_sip_session_media *media = NULL;
|
struct ast_sip_session_media *media = NULL;
|
||||||
int rtcp = 0;
|
int rtcp = 0;
|
||||||
@@ -772,7 +772,7 @@ static struct ast_frame *gulp_read(struct ast_channel *ast)
|
|||||||
if (f && (f->frametype == AST_FRAME_DTMF)) {
|
if (f && (f->frametype == AST_FRAME_DTMF)) {
|
||||||
if (f->subclass.integer == 'f') {
|
if (f->subclass.integer == 'f') {
|
||||||
ast_debug(3, "Fax CNG detected on %s\n", ast_channel_name(ast));
|
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 {
|
} else {
|
||||||
ast_debug(3, "* Detected inband DTMF '%c' on '%s'\n", f->subclass.integer,
|
ast_debug(3, "* Detected inband DTMF '%c' on '%s'\n", f->subclass.integer,
|
||||||
ast_channel_name(ast));
|
ast_channel_name(ast));
|
||||||
@@ -784,10 +784,10 @@ static struct ast_frame *gulp_read(struct ast_channel *ast)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core to write frames */
|
/*! \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 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;
|
struct ast_sip_session_media *media;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
@@ -821,7 +821,7 @@ static int gulp_write(struct ast_channel *ast, struct ast_frame *frame)
|
|||||||
case AST_FRAME_MODEM:
|
case AST_FRAME_MODEM:
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -837,7 +837,7 @@ static int fixup(void *data)
|
|||||||
{
|
{
|
||||||
struct fixup_data *fix_data = data;
|
struct fixup_data *fix_data = data;
|
||||||
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(fix_data->chan);
|
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;
|
channel->session->channel = fix_data->chan;
|
||||||
if (pvt->media[SIP_MEDIA_AUDIO] && pvt->media[SIP_MEDIA_AUDIO]->rtp) {
|
if (pvt->media[SIP_MEDIA_AUDIO] && pvt->media[SIP_MEDIA_AUDIO]->rtp) {
|
||||||
@@ -851,7 +851,7 @@ static int fixup(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core to change the underlying owner channel */
|
/*! \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 ast_sip_channel_pvt *channel = ast_channel_tech_pvt(newchan);
|
||||||
struct fixup_data fix_data;
|
struct fixup_data fix_data;
|
||||||
@@ -872,7 +872,7 @@ static int gulp_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called to get the device state of an endpoint */
|
/*! \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);
|
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;
|
enum ast_device_state state = AST_DEVICE_UNKNOWN;
|
||||||
@@ -934,7 +934,7 @@ static int gulp_devicestate(const char *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called to query options on a channel */
|
/*! \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_channel_pvt *channel = ast_channel_tech_pvt(ast);
|
||||||
struct ast_sip_session *session = channel->session;
|
struct ast_sip_session *session = channel->session;
|
||||||
@@ -1099,10 +1099,10 @@ static int update_connected_line_information(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core to ask the channel to indicate some sort of condition */
|
/*! \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 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;
|
struct ast_sip_session_media *media;
|
||||||
int response_code = 0;
|
int response_code = 0;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
@@ -1119,7 +1119,7 @@ static int gulp_indicate(struct ast_channel *ast, int condition, const void *dat
|
|||||||
} else {
|
} else {
|
||||||
res = -1;
|
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;
|
break;
|
||||||
case AST_CONTROL_BUSY:
|
case AST_CONTROL_BUSY:
|
||||||
if (ast_channel_state(ast) != AST_STATE_UP) {
|
if (ast_channel_state(ast) != AST_STATE_UP) {
|
||||||
@@ -1335,7 +1335,7 @@ static int transfer(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core for Asterisk initiated transfer */
|
/*! \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 ast_sip_channel_pvt *channel = ast_channel_tech_pvt(chan);
|
||||||
struct transfer_data *trnf_data = transfer_data_alloc(channel->session, target);
|
struct transfer_data *trnf_data = transfer_data_alloc(channel->session, target);
|
||||||
@@ -1354,10 +1354,10 @@ static int gulp_transfer(struct ast_channel *chan, const char *target)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core to start a DTMF digit */
|
/*! \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 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];
|
struct ast_sip_session_media *media = pvt->media[SIP_MEDIA_AUDIO];
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
@@ -1442,10 +1442,10 @@ static int transmit_info_dtmf(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core to stop a DTMF digit */
|
/*! \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 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];
|
struct ast_sip_session_media *media = pvt->media[SIP_MEDIA_AUDIO];
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
@@ -1498,7 +1498,7 @@ static int call(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core to actually start calling a remote party */
|
/*! \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);
|
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
|
||||||
|
|
||||||
@@ -1587,7 +1587,7 @@ static struct hangup_data *hangup_data_alloc(int cause, struct ast_channel *chan
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Clear a channel from a session along with its PVT */
|
/*! \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;
|
session->channel = NULL;
|
||||||
if (pvt->media[SIP_MEDIA_AUDIO] && pvt->media[SIP_MEDIA_AUDIO]->rtp) {
|
if (pvt->media[SIP_MEDIA_AUDIO] && pvt->media[SIP_MEDIA_AUDIO]->rtp) {
|
||||||
@@ -1606,7 +1606,7 @@ static int hangup(void *data)
|
|||||||
struct hangup_data *h_data = data;
|
struct hangup_data *h_data = data;
|
||||||
struct ast_channel *ast = h_data->chan;
|
struct ast_channel *ast = h_data->chan;
|
||||||
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(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_sip_session *session = channel->session;
|
struct ast_sip_session *session = channel->session;
|
||||||
int cause = h_data->cause;
|
int cause = h_data->cause;
|
||||||
|
|
||||||
@@ -1626,11 +1626,11 @@ static int hangup(void *data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core to hang up a Gulp session */
|
/*! \brief Function called by core to hang up a PJSIP session */
|
||||||
static int gulp_hangup(struct ast_channel *ast)
|
static int chan_pjsip_hangup(struct ast_channel *ast)
|
||||||
{
|
{
|
||||||
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(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));
|
int cause = hangup_cause2sip(ast_channel_hangupcause(channel->session->channel));
|
||||||
struct hangup_data *h_data = hangup_data_alloc(cause, ast);
|
struct hangup_data *h_data = hangup_data_alloc(cause, ast);
|
||||||
|
|
||||||
@@ -1676,7 +1676,7 @@ static int request(void *obj)
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (ast_strlen_zero(tmp)) {
|
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;
|
req_data->cause = AST_CAUSE_CHANNEL_UNACCEPTABLE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1692,10 +1692,10 @@ static int request(void *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ast_strlen_zero(endpoint_name)) {
|
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;
|
req_data->cause = AST_CAUSE_CHANNEL_UNACCEPTABLE;
|
||||||
} else if (!(endpoint = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "endpoint", endpoint_name))) {
|
} 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;
|
req_data->cause = AST_CAUSE_NO_ROUTE_DESTINATION;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1710,8 +1710,8 @@ static int request(void *obj)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core to create a new outgoing Gulp session */
|
/*! \brief Function called by core to create a new outgoing PJSIP 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)
|
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;
|
struct request_data req_data;
|
||||||
RAII_VAR(struct ast_sip_session *, session, NULL, ao2_cleanup);
|
RAII_VAR(struct ast_sip_session *, session, NULL, ao2_cleanup);
|
||||||
@@ -1726,7 +1726,7 @@ static struct ast_channel *gulp_request(const char *type, struct ast_format_cap
|
|||||||
|
|
||||||
session = req_data.session;
|
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 */
|
/* Session needs to be terminated prematurely */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1784,8 +1784,8 @@ static int sendtext(void *obj)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called by core to send text on Gulp session */
|
/*! \brief Function called by core to send text on PJSIP session */
|
||||||
static int gulp_sendtext(struct ast_channel *ast, const char *text)
|
static int chan_pjsip_sendtext(struct ast_channel *ast, const char *text)
|
||||||
{
|
{
|
||||||
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
|
struct ast_sip_channel_pvt *channel = ast_channel_tech_pvt(ast);
|
||||||
struct sendtext_data *data = sendtext_data_create(channel->session, text);
|
struct sendtext_data *data = sendtext_data_create(channel->session, text);
|
||||||
@@ -1888,7 +1888,7 @@ static int hangup_sip2cause(int cause)
|
|||||||
return 0;
|
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);
|
RAII_VAR(struct ast_datastore *, datastore, NULL, ao2_cleanup);
|
||||||
|
|
||||||
@@ -1908,7 +1908,7 @@ static void gulp_session_begin(struct ast_sip_session *session)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called when the session ends */
|
/*! \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) {
|
if (!session->channel) {
|
||||||
return;
|
return;
|
||||||
@@ -1924,7 +1924,7 @@ static void gulp_session_end(struct ast_sip_session *session)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Function called when a request is received on the session */
|
/*! \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;
|
pjsip_tx_data *packet = NULL;
|
||||||
|
|
||||||
@@ -1932,12 +1932,12 @@ static int gulp_incoming_request(struct ast_sip_session *session, struct pjsip_r
|
|||||||
return 0;
|
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) {
|
if (pjsip_inv_end_session(session->inv_session, 503, NULL, &packet) == PJ_SUCCESS) {
|
||||||
ast_sip_session_send_response(session, packet);
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
/* channel gets created on incoming request, but we wait to call start
|
/* channel gets created on incoming request, but we wait to call start
|
||||||
@@ -1967,7 +1967,7 @@ static int pbx_start_incoming_request(struct ast_sip_session *session, pjsip_rx_
|
|||||||
break;
|
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;
|
return (res == AST_PBX_SUCCESS) ? 0 : -1;
|
||||||
}
|
}
|
||||||
@@ -1979,7 +1979,7 @@ static struct ast_sip_session_supplement pbx_start_supplement = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*! \brief Function called when a response is received on the session */
|
/*! \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;
|
struct pjsip_status_line status = rdata->msg_info.msg->line.status;
|
||||||
|
|
||||||
@@ -2005,7 +2005,7 @@ static void gulp_incoming_response(struct ast_sip_session *session, struct pjsip
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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 (rdata->msg_info.msg->line.req.method.id == PJSIP_ACK_METHOD) {
|
||||||
if (session->endpoint->media.direct_media.enabled) {
|
if (session->endpoint->media.direct_media.enabled) {
|
||||||
@@ -2027,43 +2027,43 @@ static int gulp_incoming_ack(struct ast_sip_session *session, struct pjsip_rx_da
|
|||||||
*/
|
*/
|
||||||
static int load_module(void)
|
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;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_format_cap_add_all_by_type(gulp_tech.capabilities, AST_FORMAT_TYPE_AUDIO);
|
ast_format_cap_add_all_by_type(chan_pjsip_tech.capabilities, AST_FORMAT_TYPE_AUDIO);
|
||||||
|
|
||||||
ast_rtp_glue_register(&gulp_rtp_glue);
|
ast_rtp_glue_register(&chan_pjsip_rtp_glue);
|
||||||
|
|
||||||
if (ast_channel_register(&gulp_tech)) {
|
if (ast_channel_register(&chan_pjsip_tech)) {
|
||||||
ast_log(LOG_ERROR, "Unable to register channel class %s\n", channel_type);
|
ast_log(LOG_ERROR, "Unable to register channel class %s\n", channel_type);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ast_custom_function_register(&gulp_dial_contacts_function)) {
|
if (ast_custom_function_register(&chan_pjsip_dial_contacts_function)) {
|
||||||
ast_log(LOG_ERROR, "Unable to register GULP_DIAL_CONTACTS dialplan function\n");
|
ast_log(LOG_ERROR, "Unable to register PJSIP_DIAL_CONTACTS dialplan function\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ast_custom_function_register(&media_offer_function)) {
|
if (ast_custom_function_register(&media_offer_function)) {
|
||||||
ast_log(LOG_WARNING, "Unable to register GULP_MEDIA_OFFER dialplan function\n");
|
ast_log(LOG_WARNING, "Unable to register PJSIP_MEDIA_OFFER dialplan function\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ast_sip_session_register_supplement(&gulp_supplement)) {
|
if (ast_sip_session_register_supplement(&chan_pjsip_supplement)) {
|
||||||
ast_log(LOG_ERROR, "Unable to register Gulp supplement\n");
|
ast_log(LOG_ERROR, "Unable to register PJSIP supplement\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ast_sip_session_register_supplement(&pbx_start_supplement)) {
|
if (ast_sip_session_register_supplement(&pbx_start_supplement)) {
|
||||||
ast_log(LOG_ERROR, "Unable to register Gulp pbx start supplement\n");
|
ast_log(LOG_ERROR, "Unable to register PJSIP pbx start supplement\n");
|
||||||
ast_sip_session_unregister_supplement(&gulp_supplement);
|
ast_sip_session_unregister_supplement(&chan_pjsip_supplement);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ast_sip_session_register_supplement(&gulp_ack_supplement)) {
|
if (ast_sip_session_register_supplement(&chan_pjsip_ack_supplement)) {
|
||||||
ast_log(LOG_ERROR, "Unable to register Gulp ACK supplement\n");
|
ast_log(LOG_ERROR, "Unable to register PJSIP ACK supplement\n");
|
||||||
ast_sip_session_unregister_supplement(&pbx_start_supplement);
|
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;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2071,9 +2071,9 @@ static int load_module(void)
|
|||||||
|
|
||||||
end:
|
end:
|
||||||
ast_custom_function_unregister(&media_offer_function);
|
ast_custom_function_unregister(&media_offer_function);
|
||||||
ast_custom_function_unregister(&gulp_dial_contacts_function);
|
ast_custom_function_unregister(&chan_pjsip_dial_contacts_function);
|
||||||
ast_channel_unregister(&gulp_tech);
|
ast_channel_unregister(&chan_pjsip_tech);
|
||||||
ast_rtp_glue_unregister(&gulp_rtp_glue);
|
ast_rtp_glue_unregister(&chan_pjsip_rtp_glue);
|
||||||
|
|
||||||
return AST_MODULE_LOAD_FAILURE;
|
return AST_MODULE_LOAD_FAILURE;
|
||||||
}
|
}
|
||||||
@@ -2084,22 +2084,22 @@ static int reload(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Unload the Gulp channel from Asterisk */
|
/*! \brief Unload the PJSIP channel from Asterisk */
|
||||||
static int unload_module(void)
|
static int unload_module(void)
|
||||||
{
|
{
|
||||||
ast_custom_function_unregister(&media_offer_function);
|
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_sip_session_unregister_supplement(&pbx_start_supplement);
|
||||||
|
|
||||||
ast_custom_function_unregister(&gulp_dial_contacts_function);
|
ast_custom_function_unregister(&chan_pjsip_dial_contacts_function);
|
||||||
ast_channel_unregister(&gulp_tech);
|
ast_channel_unregister(&chan_pjsip_tech);
|
||||||
ast_rtp_glue_unregister(&gulp_rtp_glue);
|
ast_rtp_glue_unregister(&chan_pjsip_rtp_glue);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Gulp SIP Channel Driver",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Channel Driver",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.reload = reload,
|
.reload = reload,
|
@@ -43,8 +43,8 @@ snmp/agent.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_snmp)
|
|||||||
$(if $(filter res_ael_share,$(EMBEDDED_MODS)),modules.link,res_ael_share.so): ael/ael_lex.o ael/ael.tab.o ael/pval.o
|
$(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)
|
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))
|
$(if $(filter res_pjsip,$(EMBEDDED_MODS)),modules.link,res_pjsip.so): $(subst .c,.o,$(wildcard res_pjsip/*.c))
|
||||||
$(subst .c,.o,$(wildcard res_sip/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_sip)
|
$(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))
|
$(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)
|
$(subst .c,.o,$(wildcard stasis/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_stasis)
|
||||||
@@ -74,7 +74,7 @@ ael/pval.o: ael/pval.c
|
|||||||
|
|
||||||
clean::
|
clean::
|
||||||
rm -f snmp/*.[oi] ael/*.[oi] ais/*.[oi] ari/*.[oi]
|
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
|
rm -f parking/*.o parking/*.i
|
||||||
|
|
||||||
$(if $(filter res_parking,$(EMBEDDED_MODS)),modules.link,res_parking.so): $(subst .c,.o,$(wildcard parking/*.c))
|
$(if $(filter res_parking,$(EMBEDDED_MODS)),modules.link,res_parking.so): $(subst .c,.o,$(wildcard parking/*.c))
|
||||||
|
@@ -23,8 +23,8 @@
|
|||||||
#include <pjsip_simple.h>
|
#include <pjsip_simple.h>
|
||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "res_sip/include/res_sip_private.h"
|
#include "res_pjsip/include/res_pjsip_private.h"
|
||||||
#include "asterisk/linkedlists.h"
|
#include "asterisk/linkedlists.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/lock.h"
|
#include "asterisk/lock.h"
|
||||||
@@ -43,9 +43,9 @@
|
|||||||
***/
|
***/
|
||||||
|
|
||||||
/*** DOCUMENTATION
|
/*** DOCUMENTATION
|
||||||
<configInfo name="res_sip" language="en_US">
|
<configInfo name="res_pjsip" language="en_US">
|
||||||
<synopsis>SIP Resource using PJProject</synopsis>
|
<synopsis>SIP Resource using PJProject</synopsis>
|
||||||
<configFile name="res_sip.conf">
|
<configFile name="pjsip.conf">
|
||||||
<configObject name="endpoint">
|
<configObject name="endpoint">
|
||||||
<synopsis>Endpoint</synopsis>
|
<synopsis>Endpoint</synopsis>
|
||||||
<description><para>
|
<description><para>
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
accomplished via Addresses of Record (AoRs) which have one or more
|
accomplished via Addresses of Record (AoRs) which have one or more
|
||||||
contacts assicated with them. Endpoints <emphasis>NOT</emphasis> configured to
|
contacts assicated with them. Endpoints <emphasis>NOT</emphasis> configured to
|
||||||
use a <literal>transport</literal> will default to first transport found
|
use a <literal>transport</literal> will default to first transport found
|
||||||
in <filename>res_sip.conf</filename> that matches its type.
|
in <filename>pjsip.conf</filename> that matches its type.
|
||||||
</para>
|
</para>
|
||||||
<para>Example: An Endpoint has been configured with no transport.
|
<para>Example: An Endpoint has been configured with no transport.
|
||||||
When it comes time to call an AoR, PJSIP will find the
|
When it comes time to call an AoR, PJSIP will find the
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
<synopsis>Authentication Object(s) associated with the endpoint</synopsis>
|
<synopsis>Authentication Object(s) associated with the endpoint</synopsis>
|
||||||
<description><para>
|
<description><para>
|
||||||
This is a comma-delimited list of <replaceable>auth</replaceable> sections defined
|
This is a comma-delimited list of <replaceable>auth</replaceable> sections defined
|
||||||
in <filename>res_sip.conf</filename> to be used to verify inbound connection attempts.
|
in <filename>pjsip.conf</filename> to be used to verify inbound connection attempts.
|
||||||
</para><para>
|
</para><para>
|
||||||
Endpoints without an <literal>authentication</literal> object
|
Endpoints without an <literal>authentication</literal> object
|
||||||
configured will allow connections without vertification.
|
configured will allow connections without vertification.
|
||||||
@@ -286,7 +286,7 @@
|
|||||||
This will set the desired transport configuration to send SIP data through.
|
This will set the desired transport configuration to send SIP data through.
|
||||||
</para>
|
</para>
|
||||||
<warning><para>Not specifying a transport will <emphasis>DEFAULT</emphasis>
|
<warning><para>Not specifying a transport will <emphasis>DEFAULT</emphasis>
|
||||||
to the first configured transport in <filename>res_sip.conf</filename> which is
|
to the first configured transport in <filename>pjsip.conf</filename> which is
|
||||||
valid for the URI we are trying to contact.
|
valid for the URI we are trying to contact.
|
||||||
</para></warning>
|
</para></warning>
|
||||||
</description>
|
</description>
|
||||||
@@ -297,12 +297,12 @@
|
|||||||
identification from the endpoint from headers such as P-Asserted-Identity
|
identification from the endpoint from headers such as P-Asserted-Identity
|
||||||
or Remote-Party-ID header. This option applies both to calls originating from the
|
or Remote-Party-ID header. This option applies both to calls originating from the
|
||||||
endpoint and calls originating from Asterisk. If <literal>no</literal>, the
|
endpoint and calls originating from Asterisk. If <literal>no</literal>, the
|
||||||
configured Caller-ID from res_sip.conf will always be used as the identity for
|
configured Caller-ID from pjsip.conf will always be used as the identity for
|
||||||
the endpoint.</para></description>
|
the endpoint.</para></description>
|
||||||
</configOption>
|
</configOption>
|
||||||
<configOption name="trust_id_outbound" default="no">
|
<configOption name="trust_id_outbound" default="no">
|
||||||
<synopsis>Send private identification details to the endpoint.</synopsis>
|
<synopsis>Send private identification details to the endpoint.</synopsis>
|
||||||
<description><para>This option determines whether res_sip will send private
|
<description><para>This option determines whether res_pjsip will send private
|
||||||
identification information to the endpoint. If <literal>no</literal>,
|
identification information to the endpoint. If <literal>no</literal>,
|
||||||
private Caller-ID information will not be forwarded to the endpoint.
|
private Caller-ID information will not be forwarded to the endpoint.
|
||||||
"Private" in this case refers to any method of restricting identification.
|
"Private" in this case refers to any method of restricting identification.
|
||||||
@@ -320,46 +320,46 @@
|
|||||||
<synopsis>Use Endpoint's requested packetisation interval</synopsis>
|
<synopsis>Use Endpoint's requested packetisation interval</synopsis>
|
||||||
</configOption>
|
</configOption>
|
||||||
<configOption name="use_avpf" default="no">
|
<configOption name="use_avpf" default="no">
|
||||||
<synopsis>Determines whether res_sip will use and enforce usage of AVPF for this
|
<synopsis>Determines whether res_pjsip will use and enforce usage of AVPF for this
|
||||||
endpoint.</synopsis>
|
endpoint.</synopsis>
|
||||||
<description><para>
|
<description><para>
|
||||||
If set to <literal>yes</literal>, res_sip will use use the AVPF or SAVPF RTP
|
If set to <literal>yes</literal>, res_pjsip will use use the AVPF or SAVPF RTP
|
||||||
profile for all media offers on outbound calls and media updates and will
|
profile for all media offers on outbound calls and media updates and will
|
||||||
decline media offers not using the AVPF or SAVPF profile.
|
decline media offers not using the AVPF or SAVPF profile.
|
||||||
</para><para>
|
</para><para>
|
||||||
If set to <literal>no</literal>, res_sip will use use the AVP or SAVP RTP
|
If set to <literal>no</literal>, res_pjsip will use use the AVP or SAVP RTP
|
||||||
profile for all media offers on outbound calls and media updates and will
|
profile for all media offers on outbound calls and media updates and will
|
||||||
decline media offers not using the AVP or SAVP profile.
|
decline media offers not using the AVP or SAVP profile.
|
||||||
</para></description>
|
</para></description>
|
||||||
</configOption>
|
</configOption>
|
||||||
<configOption name="media_encryption" default="no">
|
<configOption name="media_encryption" default="no">
|
||||||
<synopsis>Determines whether res_sip will use and enforce usage of media encryption
|
<synopsis>Determines whether res_pjsip will use and enforce usage of media encryption
|
||||||
for this endpoint.</synopsis>
|
for this endpoint.</synopsis>
|
||||||
<description>
|
<description>
|
||||||
<enumlist>
|
<enumlist>
|
||||||
<enum name="no"><para>
|
<enum name="no"><para>
|
||||||
res_sip will offer no encryption and allow no encryption to be setup.
|
res_pjsip will offer no encryption and allow no encryption to be setup.
|
||||||
</para></enum>
|
</para></enum>
|
||||||
<enum name="sdes"><para>
|
<enum name="sdes"><para>
|
||||||
res_sip will offer standard SRTP setup via in-SDP keys. Encrypted SIP
|
res_pjsip will offer standard SRTP setup via in-SDP keys. Encrypted SIP
|
||||||
transport should be used in conjunction with this option to prevent
|
transport should be used in conjunction with this option to prevent
|
||||||
exposure of media encryption keys.
|
exposure of media encryption keys.
|
||||||
</para></enum>
|
</para></enum>
|
||||||
<enum name="dtls"><para>
|
<enum name="dtls"><para>
|
||||||
res_sip will offer DTLS-SRTP setup.
|
res_pjsip will offer DTLS-SRTP setup.
|
||||||
</para></enum>
|
</para></enum>
|
||||||
</enumlist>
|
</enumlist>
|
||||||
</description>
|
</description>
|
||||||
</configOption>
|
</configOption>
|
||||||
<configOption name="inband_progress" default="no">
|
<configOption name="inband_progress" default="no">
|
||||||
<synopsis>Determines whether chan_gulp will indicate ringing using inband
|
<synopsis>Determines whether chan_pjsip will indicate ringing using inband
|
||||||
progress.</synopsis>
|
progress.</synopsis>
|
||||||
<description><para>
|
<description><para>
|
||||||
If set to <literal>yes</literal>, chan_gulp will send a 183 Session Progress
|
If set to <literal>yes</literal>, chan_pjsip will send a 183 Session Progress
|
||||||
when told to indicate ringing and will immediately start sending ringing
|
when told to indicate ringing and will immediately start sending ringing
|
||||||
as audio.
|
as audio.
|
||||||
</para><para>
|
</para><para>
|
||||||
If set to <literal>no</literal>, chan_gulp will send a 180 Ringing when told
|
If set to <literal>no</literal>, chan_pjsip will send a 180 Ringing when told
|
||||||
to indicate ringing and will NOT send it as audio.
|
to indicate ringing and will NOT send it as audio.
|
||||||
</para></description>
|
</para></description>
|
||||||
</configOption>
|
</configOption>
|
||||||
@@ -395,7 +395,7 @@
|
|||||||
<synopsis>The number of in-use channels which will cause busy to be returned as device state</synopsis>
|
<synopsis>The number of in-use channels which will cause busy to be returned as device state</synopsis>
|
||||||
<description><para>
|
<description><para>
|
||||||
When the number of in-use channels for the endpoint matches the devicestate_busy_at setting the
|
When the number of in-use channels for the endpoint matches the devicestate_busy_at setting the
|
||||||
Gulp channel driver will return busy as the device state instead of in use.
|
PJSIP channel driver will return busy as the device state instead of in use.
|
||||||
</para></description>
|
</para></description>
|
||||||
</configOption>
|
</configOption>
|
||||||
<configOption name="t38udptl" default="no">
|
<configOption name="t38udptl" default="no">
|
||||||
@@ -601,13 +601,13 @@
|
|||||||
</para>
|
</para>
|
||||||
<enumlist>
|
<enumlist>
|
||||||
<enum name="active"><para>
|
<enum name="active"><para>
|
||||||
res_sip will make a connection to the peer.
|
res_pjsip will make a connection to the peer.
|
||||||
</para></enum>
|
</para></enum>
|
||||||
<enum name="passive"><para>
|
<enum name="passive"><para>
|
||||||
res_sip will accept connections from the peer.
|
res_pjsip will accept connections from the peer.
|
||||||
</para></enum>
|
</para></enum>
|
||||||
<enum name="actpass"><para>
|
<enum name="actpass"><para>
|
||||||
res_sip will offer and accept connections from the peer.
|
res_pjsip will offer and accept connections from the peer.
|
||||||
</para></enum>
|
</para></enum>
|
||||||
</enumlist>
|
</enumlist>
|
||||||
</description>
|
</description>
|
||||||
@@ -689,7 +689,7 @@
|
|||||||
<emphasis>Transports</emphasis>
|
<emphasis>Transports</emphasis>
|
||||||
</para>
|
</para>
|
||||||
<para>There are different transports and protocol derivatives
|
<para>There are different transports and protocol derivatives
|
||||||
supported by <literal>res_sip</literal>. They are in order of
|
supported by <literal>res_pjsip</literal>. They are in order of
|
||||||
preference: UDP, TCP, and WebSocket (WS).</para>
|
preference: UDP, TCP, and WebSocket (WS).</para>
|
||||||
<warning><para>
|
<warning><para>
|
||||||
Multiple endpoints using the same connection is <emphasis>NOT</emphasis>
|
Multiple endpoints using the same connection is <emphasis>NOT</emphasis>
|
||||||
@@ -826,7 +826,7 @@
|
|||||||
<configObject name="aor">
|
<configObject name="aor">
|
||||||
<synopsis>The configuration for a location of an endpoint</synopsis>
|
<synopsis>The configuration for a location of an endpoint</synopsis>
|
||||||
<description><para>
|
<description><para>
|
||||||
An AoR is what allows Asterisk to contact an endpoint via res_sip. If no
|
An AoR is what allows Asterisk to contact an endpoint via res_pjsip. If no
|
||||||
AoRs are specified, an endpoint will not be reachable by Asterisk.
|
AoRs are specified, an endpoint will not be reachable by Asterisk.
|
||||||
Beyond that, an AoR has other uses within Asterisk.
|
Beyond that, an AoR has other uses within Asterisk.
|
||||||
</para><para>
|
</para><para>
|
||||||
@@ -913,7 +913,7 @@
|
|||||||
The settings in this section are global. In addition to being global, the values will
|
The settings in this section are global. In addition to being global, the values will
|
||||||
not be re-evaluated when a reload is performed. This is because the values must be set
|
not be re-evaluated when a reload is performed. This is because the values must be set
|
||||||
before the SIP stack is initialized. The only way to reset these values is to either
|
before the SIP stack is initialized. The only way to reset these values is to either
|
||||||
restart Asterisk, or unload res_sip.so and then load it again.
|
restart Asterisk, or unload res_pjsip.so and then load it again.
|
||||||
</para></description>
|
</para></description>
|
||||||
<configOption name="timert1" default="500">
|
<configOption name="timert1" default="500">
|
||||||
<synopsis>Set transaction timer T1 value (milliseconds).</synopsis>
|
<synopsis>Set transaction timer T1 value (milliseconds).</synopsis>
|
||||||
@@ -1811,7 +1811,7 @@ static int load_module(void)
|
|||||||
|
|
||||||
ast_sip_initialize_global_headers();
|
ast_sip_initialize_global_headers();
|
||||||
|
|
||||||
if (ast_res_sip_initialize_configuration()) {
|
if (ast_res_pjsip_initialize_configuration()) {
|
||||||
ast_log(LOG_ERROR, "Failed to initialize SIP configuration. Aborting load\n");
|
ast_log(LOG_ERROR, "Failed to initialize SIP configuration. Aborting load\n");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@@ -1826,15 +1826,15 @@ static int load_module(void)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_res_sip_init_options_handling(0);
|
ast_res_pjsip_init_options_handling(0);
|
||||||
|
|
||||||
ast_res_sip_init_contact_transports();
|
ast_res_pjsip_init_contact_transports();
|
||||||
|
|
||||||
return AST_MODULE_LOAD_SUCCESS;
|
return AST_MODULE_LOAD_SUCCESS;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
ast_sip_destroy_distributor();
|
ast_sip_destroy_distributor();
|
||||||
ast_res_sip_destroy_configuration();
|
ast_res_pjsip_destroy_configuration();
|
||||||
ast_sip_destroy_global_headers();
|
ast_sip_destroy_global_headers();
|
||||||
if (monitor_thread) {
|
if (monitor_thread) {
|
||||||
stop_monitor_thread();
|
stop_monitor_thread();
|
||||||
@@ -1853,10 +1853,10 @@ error:
|
|||||||
|
|
||||||
static int reload_module(void)
|
static int reload_module(void)
|
||||||
{
|
{
|
||||||
if (ast_res_sip_reload_configuration()) {
|
if (ast_res_pjsip_reload_configuration()) {
|
||||||
return AST_MODULE_LOAD_DECLINE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
ast_res_sip_init_options_handling(1);
|
ast_res_pjsip_init_options_handling(1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1877,7 +1877,7 @@ static int unload_pjsip(void *data)
|
|||||||
static int unload_module(void)
|
static int unload_module(void)
|
||||||
{
|
{
|
||||||
ast_sip_destroy_distributor();
|
ast_sip_destroy_distributor();
|
||||||
ast_res_sip_destroy_configuration();
|
ast_res_pjsip_destroy_configuration();
|
||||||
ast_sip_destroy_global_headers();
|
ast_sip_destroy_global_headers();
|
||||||
if (monitor_thread) {
|
if (monitor_thread) {
|
||||||
stop_monitor_thread();
|
stop_monitor_thread();
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/sorcery.h"
|
#include "asterisk/sorcery.h"
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ static int auth_apply(const struct ast_sorcery *sorcery, void *obj)
|
|||||||
/*! \brief Initialize sorcery with auth support */
|
/*! \brief Initialize sorcery with auth support */
|
||||||
int ast_sip_initialize_sorcery_auth(struct ast_sorcery *sorcery)
|
int ast_sip_initialize_sorcery_auth(struct ast_sorcery *sorcery)
|
||||||
{
|
{
|
||||||
ast_sorcery_apply_default(sorcery, SIP_SORCERY_AUTH_TYPE, "config", "res_sip.conf,criteria=type=auth");
|
ast_sorcery_apply_default(sorcery, SIP_SORCERY_AUTH_TYPE, "config", "pjsip.conf,criteria=type=auth");
|
||||||
|
|
||||||
if (ast_sorcery_object_register(sorcery, SIP_SORCERY_AUTH_TYPE, auth_alloc, NULL, auth_apply)) {
|
if (ast_sorcery_object_register(sorcery, SIP_SORCERY_AUTH_TYPE, auth_alloc, NULL, auth_apply)) {
|
||||||
return -1;
|
return -1;
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "pjsip.h"
|
#include "pjsip.h"
|
||||||
#include "pjlib.h"
|
#include "pjlib.h"
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/sorcery.h"
|
#include "asterisk/sorcery.h"
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ static void *domain_alias_alloc(const char *name)
|
|||||||
/*! \brief Initialize sorcery with domain alias support */
|
/*! \brief Initialize sorcery with domain alias support */
|
||||||
int ast_sip_initialize_sorcery_domain_alias(struct ast_sorcery *sorcery)
|
int ast_sip_initialize_sorcery_domain_alias(struct ast_sorcery *sorcery)
|
||||||
{
|
{
|
||||||
ast_sorcery_apply_default(sorcery, SIP_SORCERY_DOMAIN_ALIAS_TYPE, "config", "res_sip.conf,criteria=type=domain_alias");
|
ast_sorcery_apply_default(sorcery, SIP_SORCERY_DOMAIN_ALIAS_TYPE, "config", "pjsip.conf,criteria=type=domain_alias");
|
||||||
|
|
||||||
if (ast_sorcery_object_register(sorcery, SIP_SORCERY_DOMAIN_ALIAS_TYPE, domain_alias_alloc, NULL, NULL)) {
|
if (ast_sorcery_object_register(sorcery, SIP_SORCERY_DOMAIN_ALIAS_TYPE, domain_alias_alloc, NULL, NULL)) {
|
||||||
return -1;
|
return -1;
|
@@ -21,7 +21,7 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/sorcery.h"
|
#include "asterisk/sorcery.h"
|
||||||
#include "asterisk/ast_version.h"
|
#include "asterisk/ast_version.h"
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ int ast_sip_initialize_sorcery_global(struct ast_sorcery *sorcery)
|
|||||||
{
|
{
|
||||||
snprintf(default_useragent, sizeof(default_useragent), "%s %s", DEFAULT_USERAGENT_PREFIX, ast_get_version());
|
snprintf(default_useragent, sizeof(default_useragent), "%s %s", DEFAULT_USERAGENT_PREFIX, ast_get_version());
|
||||||
|
|
||||||
ast_sorcery_apply_default(sorcery, "global", "config", "res_sip.conf,criteria=type=global");
|
ast_sorcery_apply_default(sorcery, "global", "config", "pjsip.conf,criteria=type=global");
|
||||||
|
|
||||||
if (ast_sorcery_object_register(sorcery, "global", global_alloc, NULL, global_apply)) {
|
if (ast_sorcery_object_register(sorcery, "global", global_alloc, NULL, global_apply)) {
|
||||||
return -1;
|
return -1;
|
@@ -19,14 +19,14 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
#include "asterisk.h"
|
#include "asterisk.h"
|
||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/sorcery.h"
|
#include "asterisk/sorcery.h"
|
||||||
#include "asterisk/acl.h"
|
#include "asterisk/acl.h"
|
||||||
@@ -67,7 +67,7 @@ static void *security_alloc(const char *name)
|
|||||||
int ast_sip_initialize_sorcery_security(struct ast_sorcery *sorcery)
|
int ast_sip_initialize_sorcery_security(struct ast_sorcery *sorcery)
|
||||||
{
|
{
|
||||||
ast_sorcery_apply_default(sorcery, SIP_SORCERY_SECURITY_TYPE,
|
ast_sorcery_apply_default(sorcery, SIP_SORCERY_SECURITY_TYPE,
|
||||||
"config", "res_sip.conf,criteria=type=security");
|
"config", "pjsip.conf,criteria=type=security");
|
||||||
|
|
||||||
if (ast_sorcery_object_register(sorcery, SIP_SORCERY_SECURITY_TYPE,
|
if (ast_sorcery_object_register(sorcery, SIP_SORCERY_SECURITY_TYPE,
|
||||||
security_alloc, NULL, NULL)) {
|
security_alloc, NULL, NULL)) {
|
@@ -21,9 +21,9 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/sorcery.h"
|
#include "asterisk/sorcery.h"
|
||||||
#include "include/res_sip_private.h"
|
#include "include/res_pjsip_private.h"
|
||||||
|
|
||||||
#define TIMER_T1_MIN 100
|
#define TIMER_T1_MIN 100
|
||||||
#define DEFAULT_TIMER_T1 500
|
#define DEFAULT_TIMER_T1 500
|
||||||
@@ -88,9 +88,9 @@ int ast_sip_initialize_system(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_sorcery_apply_config(system_sorcery, "res_sip");
|
ast_sorcery_apply_config(system_sorcery, "res_pjsip");
|
||||||
|
|
||||||
ast_sorcery_apply_default(system_sorcery, "system", "config", "res_sip.conf,criteria=type=system");
|
ast_sorcery_apply_default(system_sorcery, "system", "config", "pjsip.conf,criteria=type=system");
|
||||||
|
|
||||||
if (ast_sorcery_object_register(system_sorcery, "system", system_alloc, NULL, system_apply)) {
|
if (ast_sorcery_object_register(system_sorcery, "system", system_alloc, NULL, system_apply)) {
|
||||||
ast_sorcery_unref(system_sorcery);
|
ast_sorcery_unref(system_sorcery);
|
@@ -21,7 +21,7 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/astobj2.h"
|
#include "asterisk/astobj2.h"
|
||||||
#include "asterisk/sorcery.h"
|
#include "asterisk/sorcery.h"
|
||||||
@@ -307,7 +307,7 @@ static int transport_localnet_handler(const struct aco_option *opt, struct ast_v
|
|||||||
/*! \brief Initialize sorcery with transport support */
|
/*! \brief Initialize sorcery with transport support */
|
||||||
int ast_sip_initialize_sorcery_transport(struct ast_sorcery *sorcery)
|
int ast_sip_initialize_sorcery_transport(struct ast_sorcery *sorcery)
|
||||||
{
|
{
|
||||||
ast_sorcery_apply_default(sorcery, "transport", "config", "res_sip.conf,criteria=type=transport");
|
ast_sorcery_apply_default(sorcery, "transport", "config", "pjsip.conf,criteria=type=transport");
|
||||||
|
|
||||||
if (ast_sorcery_object_register(sorcery, "transport", transport_alloc, NULL, transport_apply)) {
|
if (ast_sorcery_object_register(sorcery, "transport", transport_alloc, NULL, transport_apply)) {
|
||||||
return -1;
|
return -1;
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* res_sip.h
|
* res_pjsip.h
|
||||||
*
|
*
|
||||||
* Created on: Jan 25, 2013
|
* Created on: Jan 25, 2013
|
||||||
* Author: mjordan
|
* Author: mjordan
|
||||||
@@ -11,19 +11,19 @@
|
|||||||
struct ao2_container;
|
struct ao2_container;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Initialize the configuration for res_sip
|
* \brief Initialize the configuration for res_pjsip
|
||||||
*/
|
*/
|
||||||
int ast_res_sip_initialize_configuration(void);
|
int ast_res_pjsip_initialize_configuration(void);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Annihilate the configuration objects
|
* \brief Annihilate the configuration objects
|
||||||
*/
|
*/
|
||||||
void ast_res_sip_destroy_configuration(void);
|
void ast_res_pjsip_destroy_configuration(void);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Reload the configuration
|
* \brief Reload the configuration
|
||||||
*/
|
*/
|
||||||
int ast_res_sip_reload_configuration(void);
|
int ast_res_pjsip_reload_configuration(void);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Initialize OPTIONS request handling.
|
* \brief Initialize OPTIONS request handling.
|
||||||
@@ -37,7 +37,7 @@ int ast_res_sip_reload_configuration(void);
|
|||||||
* \retval 0 on success
|
* \retval 0 on success
|
||||||
* \retval other on failure
|
* \retval other on failure
|
||||||
*/
|
*/
|
||||||
int ast_res_sip_init_options_handling(int reload);
|
int ast_res_pjsip_init_options_handling(int reload);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Initialize transport storage for contacts.
|
* \brief Initialize transport storage for contacts.
|
||||||
@@ -45,7 +45,7 @@ int ast_res_sip_init_options_handling(int reload);
|
|||||||
* \retval 0 on success
|
* \retval 0 on success
|
||||||
* \retval other on failure
|
* \retval other on failure
|
||||||
*/
|
*/
|
||||||
int ast_res_sip_init_contact_transports(void);
|
int ast_res_pjsip_init_contact_transports(void);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Initialize outbound authentication support
|
* \brief Initialize outbound authentication support
|
@@ -20,11 +20,11 @@
|
|||||||
#include "pjsip.h"
|
#include "pjsip.h"
|
||||||
#include "pjlib.h"
|
#include "pjlib.h"
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/astobj2.h"
|
#include "asterisk/astobj2.h"
|
||||||
#include "asterisk/sorcery.h"
|
#include "asterisk/sorcery.h"
|
||||||
#include "include/res_sip_private.h"
|
#include "include/res_pjsip_private.h"
|
||||||
|
|
||||||
#define CONTACT_TRANSPORTS_BUCKETS 7
|
#define CONTACT_TRANSPORTS_BUCKETS 7
|
||||||
static struct ao2_container *contact_transports;
|
static struct ao2_container *contact_transports;
|
||||||
@@ -286,7 +286,7 @@ static int permanent_uri_handler(const struct aco_option *opt, struct ast_variab
|
|||||||
int ast_sip_initialize_sorcery_location(struct ast_sorcery *sorcery)
|
int ast_sip_initialize_sorcery_location(struct ast_sorcery *sorcery)
|
||||||
{
|
{
|
||||||
ast_sorcery_apply_default(sorcery, "contact", "astdb", "registrar");
|
ast_sorcery_apply_default(sorcery, "contact", "astdb", "registrar");
|
||||||
ast_sorcery_apply_default(sorcery, "aor", "config", "res_sip.conf,criteria=type=aor");
|
ast_sorcery_apply_default(sorcery, "aor", "config", "pjsip.conf,criteria=type=aor");
|
||||||
|
|
||||||
if (ast_sorcery_object_register(sorcery, "contact", contact_alloc, NULL, NULL) ||
|
if (ast_sorcery_object_register(sorcery, "contact", contact_alloc, NULL, NULL) ||
|
||||||
ast_sorcery_object_register(sorcery, "aor", aor_alloc, NULL, NULL)) {
|
ast_sorcery_object_register(sorcery, "aor", aor_alloc, NULL, NULL)) {
|
||||||
@@ -313,7 +313,7 @@ int ast_sip_initialize_sorcery_location(struct ast_sorcery *sorcery)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ast_res_sip_init_contact_transports(void)
|
int ast_res_pjsip_init_contact_transports(void)
|
||||||
{
|
{
|
||||||
if (contact_transports) {
|
if (contact_transports) {
|
||||||
ao2_t_ref(contact_transports, -1, "Remove old contact transports");
|
ao2_t_ref(contact_transports, -1, "Remove old contact transports");
|
@@ -10,8 +10,8 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "include/res_sip_private.h"
|
#include "include/res_pjsip_private.h"
|
||||||
#include "asterisk/cli.h"
|
#include "asterisk/cli.h"
|
||||||
#include "asterisk/astobj2.h"
|
#include "asterisk/astobj2.h"
|
||||||
#include "asterisk/utils.h"
|
#include "asterisk/utils.h"
|
||||||
@@ -76,7 +76,7 @@ static int persistent_endpoint_update_state(void *obj, void *arg, int flags)
|
|||||||
|
|
||||||
ast_endpoint_blob_publish(persistent->endpoint, ast_endpoint_state_type(), blob);
|
ast_endpoint_blob_publish(persistent->endpoint, ast_endpoint_state_type(), blob);
|
||||||
|
|
||||||
ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, "Gulp/%s", ast_endpoint_get_resource(persistent->endpoint));
|
ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, "PJSIP/%s", ast_endpoint_get_resource(persistent->endpoint));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -105,10 +105,10 @@ static char *handle_cli_show_endpoints(struct ast_cli_entry *e, int cmd, struct
|
|||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case CLI_INIT:
|
case CLI_INIT:
|
||||||
e->command = "sip show endpoints";
|
e->command = "pjsip show endpoints";
|
||||||
e->usage =
|
e->usage =
|
||||||
"Usage: sip show endpoints\n"
|
"Usage: pjsip show endpoints\n"
|
||||||
" Show the registered SIP endpoints\n";
|
" Show the registered PJSIP endpoints\n";
|
||||||
return NULL;
|
return NULL;
|
||||||
case CLI_GENERATE:
|
case CLI_GENERATE:
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -191,10 +191,10 @@ static char *cli_show_endpoint(struct ast_cli_entry *e, int cmd, struct ast_cli_
|
|||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case CLI_INIT:
|
case CLI_INIT:
|
||||||
e->command = "sip show endpoint";
|
e->command = "pjsip show endpoint";
|
||||||
e->usage =
|
e->usage =
|
||||||
"Usage: sip show endpoint <endpoint>\n"
|
"Usage: pjsip show endpoint <endpoint>\n"
|
||||||
" Show the given SIP endpoint.\n";
|
" Show the given PJSIP endpoint.\n";
|
||||||
return NULL;
|
return NULL;
|
||||||
case CLI_GENERATE:
|
case CLI_GENERATE:
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -219,8 +219,8 @@ static char *cli_show_endpoint(struct ast_cli_entry *e, int cmd, struct ast_cli_
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct ast_cli_entry cli_commands[] = {
|
static struct ast_cli_entry cli_commands[] = {
|
||||||
AST_CLI_DEFINE(handle_cli_show_endpoints, "Show SIP Endpoints"),
|
AST_CLI_DEFINE(handle_cli_show_endpoints, "Show PJSIP Endpoints"),
|
||||||
AST_CLI_DEFINE(cli_show_endpoint, "Show SIP Endpoint")
|
AST_CLI_DEFINE(cli_show_endpoint, "Show PJSIP Endpoint")
|
||||||
};
|
};
|
||||||
|
|
||||||
static int dtmf_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
|
static int dtmf_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
|
||||||
@@ -562,7 +562,7 @@ static struct ast_endpoint *persistent_endpoint_find_or_create(const struct ast_
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(persistent->endpoint = ast_endpoint_create("Gulp", ast_sorcery_object_get_id(endpoint)))) {
|
if (!(persistent->endpoint = ast_endpoint_create("PJSIP", ast_sorcery_object_get_id(endpoint)))) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -593,7 +593,7 @@ static int sip_endpoint_apply_handler(const struct ast_sorcery *sorcery, void *o
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ast_res_sip_initialize_configuration(void)
|
int ast_res_pjsip_initialize_configuration(void)
|
||||||
{
|
{
|
||||||
if (ast_cli_register_multiple(cli_commands, ARRAY_LEN(cli_commands))) {
|
if (ast_cli_register_multiple(cli_commands, ARRAY_LEN(cli_commands))) {
|
||||||
return -1;
|
return -1;
|
||||||
@@ -608,7 +608,7 @@ int ast_res_sip_initialize_configuration(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_sorcery_apply_config(sip_sorcery, "res_sip");
|
ast_sorcery_apply_config(sip_sorcery, "res_pjsip");
|
||||||
|
|
||||||
if (ast_sip_initialize_sorcery_auth(sip_sorcery)) {
|
if (ast_sip_initialize_sorcery_auth(sip_sorcery)) {
|
||||||
ast_log(LOG_ERROR, "Failed to register SIP authentication support\n");
|
ast_log(LOG_ERROR, "Failed to register SIP authentication support\n");
|
||||||
@@ -617,7 +617,7 @@ int ast_res_sip_initialize_configuration(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_sorcery_apply_default(sip_sorcery, "endpoint", "config", "res_sip.conf,criteria=type=endpoint");
|
ast_sorcery_apply_default(sip_sorcery, "endpoint", "config", "pjsip.conf,criteria=type=endpoint");
|
||||||
|
|
||||||
ast_sorcery_apply_default(sip_sorcery, "nat_hook", "memory", NULL);
|
ast_sorcery_apply_default(sip_sorcery, "nat_hook", "memory", NULL);
|
||||||
|
|
||||||
@@ -759,13 +759,13 @@ int ast_res_sip_initialize_configuration(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ast_res_sip_destroy_configuration(void)
|
void ast_res_pjsip_destroy_configuration(void)
|
||||||
{
|
{
|
||||||
ast_cli_unregister_multiple(cli_commands, ARRAY_LEN(cli_commands));
|
ast_cli_unregister_multiple(cli_commands, ARRAY_LEN(cli_commands));
|
||||||
ast_sorcery_unref(sip_sorcery);
|
ast_sorcery_unref(sip_sorcery);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ast_res_sip_reload_configuration(void)
|
int ast_res_pjsip_reload_configuration(void)
|
||||||
{
|
{
|
||||||
if (sip_sorcery) {
|
if (sip_sorcery) {
|
||||||
ast_sorcery_reload(sip_sorcery);
|
ast_sorcery_reload(sip_sorcery);
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
|
|
||||||
static int distribute(void *data);
|
static int distribute(void *data);
|
||||||
static pj_bool_t distributor(pjsip_rx_data *rdata);
|
static pj_bool_t distributor(pjsip_rx_data *rdata);
|
@@ -21,7 +21,7 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/linkedlists.h"
|
#include "asterisk/linkedlists.h"
|
||||||
|
|
||||||
static pj_status_t add_request_headers(pjsip_tx_data *tdata);
|
static pj_status_t add_request_headers(pjsip_tx_data *tdata);
|
@@ -22,13 +22,13 @@
|
|||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/channel.h"
|
#include "asterisk/channel.h"
|
||||||
#include "asterisk/pbx.h"
|
#include "asterisk/pbx.h"
|
||||||
#include "asterisk/astobj2.h"
|
#include "asterisk/astobj2.h"
|
||||||
#include "asterisk/cli.h"
|
#include "asterisk/cli.h"
|
||||||
#include "asterisk/time.h"
|
#include "asterisk/time.h"
|
||||||
#include "include/res_sip_private.h"
|
#include "include/res_pjsip_private.h"
|
||||||
|
|
||||||
#define DEFAULT_LANGUAGE "en"
|
#define DEFAULT_LANGUAGE "en"
|
||||||
#define DEFAULT_ENCODING "text/plain"
|
#define DEFAULT_ENCODING "text/plain"
|
||||||
@@ -741,7 +741,7 @@ static void qualify_and_schedule_permanent(void)
|
|||||||
qualify_and_schedule_permanent_cb, NULL);
|
qualify_and_schedule_permanent_cb, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ast_res_sip_init_options_handling(int reload)
|
int ast_res_pjsip_init_options_handling(int reload)
|
||||||
{
|
{
|
||||||
const pj_str_t STR_OPTIONS = { "OPTIONS", 7 };
|
const pj_str_t STR_OPTIONS = { "OPTIONS", 7 };
|
||||||
|
|
@@ -21,9 +21,9 @@
|
|||||||
#define bzero bzero
|
#define bzero bzero
|
||||||
#include "pjsip.h"
|
#include "pjsip.h"
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "include/res_sip_private.h"
|
#include "include/res_pjsip_private.h"
|
||||||
|
|
||||||
static pj_bool_t outbound_auth(pjsip_rx_data *rdata);
|
static pj_bool_t outbound_auth(pjsip_rx_data *rdata);
|
||||||
|
|
@@ -30,7 +30,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/security_events.h"
|
#include "asterisk/security_events.h"
|
||||||
|
|
||||||
static int find_transport_in_use(void *obj, void *arg, int flags)
|
static int find_transport_in_use(void *obj, void *arg, int flags)
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -26,21 +26,21 @@
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/sorcery.h"
|
#include "asterisk/sorcery.h"
|
||||||
#include "asterisk/acl.h"
|
#include "asterisk/acl.h"
|
||||||
|
|
||||||
/*** DOCUMENTATION
|
/*** DOCUMENTATION
|
||||||
<configInfo name="res_sip_acl" language="en_US">
|
<configInfo name="res_pjsip_acl" language="en_US">
|
||||||
<synopsis>SIP ACL module</synopsis>
|
<synopsis>SIP ACL module</synopsis>
|
||||||
<description><para>
|
<description><para>
|
||||||
<emphasis>ACL</emphasis>
|
<emphasis>ACL</emphasis>
|
||||||
</para>
|
</para>
|
||||||
<para>The ACL module used by <literal>res_sip</literal>. This module is
|
<para>The ACL module used by <literal>res_pjsip</literal>. This module is
|
||||||
independent of <literal>endpoints</literal> and operates on all inbound
|
independent of <literal>endpoints</literal> and operates on all inbound
|
||||||
SIP communication using res_sip.
|
SIP communication using res_pjsip.
|
||||||
</para><para>
|
</para><para>
|
||||||
It should be noted that this module can also reference ACLs from
|
It should be noted that this module can also reference ACLs from
|
||||||
<filename>acl.conf</filename>.
|
<filename>acl.conf</filename>.
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
and <literal>Contact Header</literal>. It is possible to create a combined ACL using
|
and <literal>Contact Header</literal>. It is possible to create a combined ACL using
|
||||||
both IP and Contact.
|
both IP and Contact.
|
||||||
</para></description>
|
</para></description>
|
||||||
<configFile name="res_sip.conf">
|
<configFile name="pjsip.conf">
|
||||||
<configObject name="acl">
|
<configObject name="acl">
|
||||||
<synopsis>Access Control List</synopsis>
|
<synopsis>Access Control List</synopsis>
|
||||||
<configOption name="acl">
|
<configOption name="acl">
|
||||||
@@ -206,7 +206,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP ACL Resource",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP ACL Resource",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -20,14 +20,14 @@
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/strings.h"
|
#include "asterisk/strings.h"
|
||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -459,7 +459,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP authentication resource",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP authentication resource",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.reload = reload_module,
|
.reload = reload_module,
|
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_session</depend>
|
<depend>res_pjsip_session</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
#include "asterisk/channel.h"
|
#include "asterisk/channel.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/callerid.h"
|
#include "asterisk/callerid.h"
|
||||||
@@ -710,7 +710,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP Caller ID Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Caller ID Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_session</depend>
|
<depend>res_pjsip_session</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
#include "asterisk/callerid.h"
|
#include "asterisk/callerid.h"
|
||||||
#include "asterisk/channel.h"
|
#include "asterisk/channel.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
@@ -339,7 +339,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP Add Diversion Header Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Add Diversion Header Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_session</depend>
|
<depend>res_pjsip_session</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
|
|
||||||
static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
|
static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
|
||||||
@@ -122,7 +122,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP DTMF INFO Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP DTMF INFO Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
|
|
||||||
static int get_endpoint_details(pjsip_rx_data *rdata, char *domain, size_t domain_size)
|
static int get_endpoint_details(pjsip_rx_data *rdata, char *domain, size_t domain_size)
|
||||||
@@ -118,7 +118,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP Anonymous endpoint identifier",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Anonymous endpoint identifier",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_DEFAULT,
|
.load_pri = AST_MODPRI_DEFAULT,
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<defaultenabled>no</defaultenabled>
|
<defaultenabled>no</defaultenabled>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
|
|
||||||
static struct ast_sip_endpoint *constant_identify(pjsip_rx_data *rdata)
|
static struct ast_sip_endpoint *constant_identify(pjsip_rx_data *rdata)
|
||||||
@@ -61,7 +61,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP Constant Endpoint Identifier",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Constant Endpoint Identifier",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -26,14 +26,14 @@
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/acl.h"
|
#include "asterisk/acl.h"
|
||||||
|
|
||||||
/*** DOCUMENTATION
|
/*** DOCUMENTATION
|
||||||
<configInfo name="res_sip_endpoint_identifier_ip" language="en_US">
|
<configInfo name="res_pjsip_endpoint_identifier_ip" language="en_US">
|
||||||
<synopsis>Module that identifies endpoints via source IP address</synopsis>
|
<synopsis>Module that identifies endpoints via source IP address</synopsis>
|
||||||
<configFile name="res_sip.conf">
|
<configFile name="res_pjsip.conf">
|
||||||
<configObject name="identify">
|
<configObject name="identify">
|
||||||
<configOption name="endpoint">
|
<configOption name="endpoint">
|
||||||
<synopsis>Name of Endpoint</synopsis>
|
<synopsis>Name of Endpoint</synopsis>
|
||||||
@@ -135,7 +135,7 @@ static int ip_identify_match_handler(const struct aco_option *opt, struct ast_va
|
|||||||
|
|
||||||
static int load_module(void)
|
static int load_module(void)
|
||||||
{
|
{
|
||||||
ast_sorcery_apply_default(ast_sip_get_sorcery(), "identify", "config", "res_sip.conf,criteria=type=identify");
|
ast_sorcery_apply_default(ast_sip_get_sorcery(), "identify", "config", "res_pjsip.conf,criteria=type=identify");
|
||||||
|
|
||||||
if (ast_sorcery_object_register(ast_sip_get_sorcery(), "identify", ip_identify_alloc, NULL, NULL)) {
|
if (ast_sorcery_object_register(ast_sip_get_sorcery(), "identify", ip_identify_alloc, NULL, NULL)) {
|
||||||
return AST_MODULE_LOAD_DECLINE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
@@ -163,7 +163,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP IP endpoint identifier",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP IP endpoint identifier",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.reload = reload_module,
|
.reload = reload_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
|
|
||||||
static int get_endpoint_details(pjsip_rx_data *rdata, char *endpoint, size_t endpoint_size, char *domain, size_t domain_size)
|
static int get_endpoint_details(pjsip_rx_data *rdata, char *endpoint, size_t endpoint_size, char *domain, size_t domain_size)
|
||||||
@@ -122,7 +122,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP username endpoint identifier",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP username endpoint identifier",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_pubsub</depend>
|
<depend>res_pjsip_pubsub</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -29,9 +29,9 @@
|
|||||||
#include <pjsip_simple.h>
|
#include <pjsip_simple.h>
|
||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_pubsub.h"
|
#include "asterisk/res_pjsip_pubsub.h"
|
||||||
#include "asterisk/res_sip_exten_state.h"
|
#include "asterisk/res_pjsip_exten_state.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/astobj2.h"
|
#include "asterisk/astobj2.h"
|
||||||
@@ -614,7 +614,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "SIP Extension State Notifications",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "PJSIP Extension State Notifications",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_CHANNEL_DEPEND,
|
.load_pri = AST_MODPRI_CHANNEL_DEPEND,
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP Packet Logger",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Packet Logger",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_session</depend>
|
<depend>res_pjsip_session</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -30,8 +30,8 @@
|
|||||||
#include "asterisk/message.h"
|
#include "asterisk/message.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/pbx.h"
|
#include "asterisk/pbx.h"
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
|
|
||||||
const pjsip_method pjsip_message_method = {PJSIP_OTHER_METHOD, {"MESSAGE", 7} };
|
const pjsip_method pjsip_message_method = {PJSIP_OTHER_METHOD, {"MESSAGE", 7} };
|
||||||
|
|
||||||
@@ -653,7 +653,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP Messaging Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Messaging Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
#include <pjsip_simple.h>
|
#include <pjsip_simple.h>
|
||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_pubsub.h"
|
#include "asterisk/res_pjsip_pubsub.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/astobj2.h"
|
#include "asterisk/astobj2.h"
|
||||||
@@ -39,8 +39,8 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_pubsub</depend>
|
<depend>res_pjsip_pubsub</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -715,7 +715,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP MWI resource",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP MWI resource",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.reload = reload,
|
.reload = reload,
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/acl.h"
|
#include "asterisk/acl.h"
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP NAT Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP NAT Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
#include "asterisk/manager.h"
|
#include "asterisk/manager.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/pbx.h"
|
#include "asterisk/pbx.h"
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/sorcery.h"
|
#include "asterisk/sorcery.h"
|
||||||
|
|
||||||
#define CONTENT_TYPE_SIZE 64
|
#define CONTENT_TYPE_SIZE 64
|
||||||
@@ -584,9 +584,9 @@ static char *cli_notify(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a
|
|||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case CLI_INIT:
|
case CLI_INIT:
|
||||||
e->command = "gulp notify";
|
e->command = "pjsip notify";
|
||||||
e->usage =
|
e->usage =
|
||||||
"Usage: gulp notify <type> <peer> [<peer>...]\n"
|
"Usage: pjsip notify <type> <peer> [<peer>...]\n"
|
||||||
" Send a NOTIFY request to an endpoint\n"
|
" Send a NOTIFY request to an endpoint\n"
|
||||||
" Message types are defined in sip_notify.conf\n";
|
" Message types are defined in sip_notify.conf\n";
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -645,7 +645,7 @@ static int manager_notify(struct mansession *s, const struct message *m)
|
|||||||
struct ast_variable *vars = astman_get_variables(m);
|
struct ast_variable *vars = astman_get_variables(m);
|
||||||
|
|
||||||
if (ast_strlen_zero(endpoint_name)) {
|
if (ast_strlen_zero(endpoint_name)) {
|
||||||
astman_send_error(s, m, "GulpNotify requires a channel name");
|
astman_send_error(s, m, "PJSIPNotify requires a channel name");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -687,7 +687,7 @@ static int load_module(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ast_cli_register_multiple(cli_options, ARRAY_LEN(cli_options));
|
ast_cli_register_multiple(cli_options, ARRAY_LEN(cli_options));
|
||||||
ast_manager_register_xml("GulpNotify", EVENT_FLAG_SYSTEM, manager_notify);
|
ast_manager_register_xml("PJSIPNotify", EVENT_FLAG_SYSTEM, manager_notify);
|
||||||
|
|
||||||
return AST_MODULE_LOAD_SUCCESS;
|
return AST_MODULE_LOAD_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -700,13 +700,13 @@ static int reload_module(void)
|
|||||||
|
|
||||||
static int unload_module(void)
|
static int unload_module(void)
|
||||||
{
|
{
|
||||||
ast_manager_unregister("GulpNotify");
|
ast_manager_unregister("PJSIPNotify");
|
||||||
aco_info_destroy(¬ify_cfg);
|
aco_info_destroy(¬ify_cfg);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "CLI/AGI SIP Notify Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "CLI/AMI PJSIP Notify Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.reload = reload_module,
|
.reload = reload_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_session</depend>
|
<depend>res_pjsip_session</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
|
|
||||||
#include "asterisk/features.h"
|
#include "asterisk/features.h"
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/features_config.h"
|
#include "asterisk/features_config.h"
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP INFO One Touch Recording Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP INFO One Touch Recording Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/strings.h"
|
#include "asterisk/strings.h"
|
||||||
@@ -112,7 +112,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP authentication resource",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP authentication resource",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_CHANNEL_DEPEND,
|
.load_pri = AST_MODPRI_CHANNEL_DEPEND,
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -27,24 +27,24 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/taskprocessor.h"
|
#include "asterisk/taskprocessor.h"
|
||||||
|
|
||||||
/*** DOCUMENTATION
|
/*** DOCUMENTATION
|
||||||
<configInfo name="res_sip_outbound_registration" language="en_US">
|
<configInfo name="res_pjsip_outbound_registration" language="en_US">
|
||||||
<synopsis>SIP resource for outbound registrations</synopsis>
|
<synopsis>SIP resource for outbound registrations</synopsis>
|
||||||
<description><para>
|
<description><para>
|
||||||
<emphasis>Outbound Registration</emphasis>
|
<emphasis>Outbound Registration</emphasis>
|
||||||
</para>
|
</para>
|
||||||
<para>This module allows <literal>res_sip</literal> to register to other SIP servers.</para>
|
<para>This module allows <literal>res_pjsip</literal> to register to other SIP servers.</para>
|
||||||
</description>
|
</description>
|
||||||
<configFile name="res_sip.conf">
|
<configFile name="pjsip.conf">
|
||||||
<configObject name="registration">
|
<configObject name="registration">
|
||||||
<synopsis>The configuration for outbound registration</synopsis>
|
<synopsis>The configuration for outbound registration</synopsis>
|
||||||
<description><para>
|
<description><para>
|
||||||
Registration is <emphasis>COMPLETELY</emphasis> separate from the rest of
|
Registration is <emphasis>COMPLETELY</emphasis> separate from the rest of
|
||||||
<literal>res_sip.conf</literal>. A minimal configuration consists of
|
<literal>pjsip.conf</literal>. A minimal configuration consists of
|
||||||
setting a <literal>server_uri</literal> and a <literal>client_uri</literal>.
|
setting a <literal>server_uri</literal> and a <literal>client_uri</literal>.
|
||||||
</para></description>
|
</para></description>
|
||||||
<configOption name="auth_rejection_permanent" default="yes">
|
<configOption name="auth_rejection_permanent" default="yes">
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
<synopsis>Transport used for outbound authentication</synopsis>
|
<synopsis>Transport used for outbound authentication</synopsis>
|
||||||
<description>
|
<description>
|
||||||
<note><para>A <replaceable>transport</replaceable> configured in
|
<note><para>A <replaceable>transport</replaceable> configured in
|
||||||
<literal>res_sip.conf</literal>. As with other <literal>res_sip</literal> modules, this will use the first available transport of the appropriate type if unconfigured.</para></note>
|
<literal>pjsip.conf</literal>. As with other <literal>res_pjsip</literal> modules, this will use the first available transport of the appropriate type if unconfigured.</para></note>
|
||||||
</description>
|
</description>
|
||||||
</configOption>
|
</configOption>
|
||||||
<configOption name="type">
|
<configOption name="type">
|
||||||
@@ -706,7 +706,7 @@ static int outbound_auth_handler(const struct aco_option *opt, struct ast_variab
|
|||||||
|
|
||||||
static int load_module(void)
|
static int load_module(void)
|
||||||
{
|
{
|
||||||
ast_sorcery_apply_default(ast_sip_get_sorcery(), "registration", "config", "res_sip.conf,criteria=type=registration");
|
ast_sorcery_apply_default(ast_sip_get_sorcery(), "registration", "config", "pjsip.conf,criteria=type=registration");
|
||||||
|
|
||||||
if (ast_sorcery_object_register(ast_sip_get_sorcery(), "registration", sip_outbound_registration_alloc, NULL, sip_outbound_registration_apply)) {
|
if (ast_sorcery_object_register(ast_sip_get_sorcery(), "registration", sip_outbound_registration_alloc, NULL, sip_outbound_registration_apply)) {
|
||||||
return AST_MODULE_LOAD_DECLINE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
@@ -741,7 +741,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP Outbound Registration Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Outbound Registration Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.reload = reload_module,
|
.reload = reload_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
@@ -18,9 +18,9 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_pubsub</depend>
|
<depend>res_pjsip_pubsub</depend>
|
||||||
<depend>res_sip_exten_state</depend>
|
<depend>res_pjsip_exten_state</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
|
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_exten_state.h"
|
#include "asterisk/res_pjsip_exten_state.h"
|
||||||
|
|
||||||
enum state {
|
enum state {
|
||||||
NOTIFY_OPEN,
|
NOTIFY_OPEN,
|
||||||
@@ -334,7 +334,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP Extension State PIDF Provider",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Extension State PIDF Provider",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_CHANNEL_DEPEND,
|
.load_pri = AST_MODPRI_CHANNEL_DEPEND,
|
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
#include <pjsip_simple.h>
|
#include <pjsip_simple.h>
|
||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip_pubsub.h"
|
#include "asterisk/res_pjsip_pubsub.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/linkedlists.h"
|
#include "asterisk/linkedlists.h"
|
||||||
#include "asterisk/astobj2.h"
|
#include "asterisk/astobj2.h"
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
#include "asterisk/uuid.h"
|
#include "asterisk/uuid.h"
|
||||||
#include "asterisk/taskprocessor.h"
|
#include "asterisk/taskprocessor.h"
|
||||||
#include "asterisk/sched.h"
|
#include "asterisk/sched.h"
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
|
|
||||||
static pj_bool_t pubsub_on_rx_request(pjsip_rx_data *rdata);
|
static pj_bool_t pubsub_on_rx_request(pjsip_rx_data *rdata);
|
||||||
|
|
||||||
@@ -1148,7 +1148,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "SIP event resource",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "PJSIP event resource",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_CHANNEL_DEPEND,
|
.load_pri = AST_MODPRI_CHANNEL_DEPEND,
|
@@ -18,9 +18,9 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_session</depend>
|
<depend>res_pjsip_session</depend>
|
||||||
<depend>res_sip_pubsub</depend>
|
<depend>res_pjsip_pubsub</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/pbx.h"
|
#include "asterisk/pbx.h"
|
||||||
#include "asterisk/taskprocessor.h"
|
#include "asterisk/taskprocessor.h"
|
||||||
@@ -860,7 +860,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP Blind and Attended Transfer Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Blind and Attended Transfer Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
|
|
||||||
/*! \brief Internal function which returns the expiration time for a contact */
|
/*! \brief Internal function which returns the expiration time for a contact */
|
||||||
@@ -383,7 +383,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP Registrar Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Registrar Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/sched.h"
|
#include "asterisk/sched.h"
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP Contact Auto-Expiration",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Contact Auto-Expiration",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_session</depend>
|
<depend>res_pjsip_session</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
#include <pjsip.h>
|
#include <pjsip.h>
|
||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/causes.h"
|
#include "asterisk/causes.h"
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP RFC3326 Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP RFC3326 Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -26,8 +26,8 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_session</depend>
|
<depend>res_pjsip_session</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -49,8 +49,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
#include "asterisk/acl.h"
|
#include "asterisk/acl.h"
|
||||||
#include "asterisk/sdp_srtp.h"
|
#include "asterisk/sdp_srtp.h"
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
|
|
||||||
/*! \brief Scheduler for RTCP purposes */
|
/*! \brief Scheduler for RTCP purposes */
|
||||||
static struct ast_sched_context *sched;
|
static struct ast_sched_context *sched;
|
||||||
@@ -1208,7 +1208,7 @@ end:
|
|||||||
return AST_MODULE_LOAD_FAILURE;
|
return AST_MODULE_LOAD_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP SDP RTP/AVP stream handler",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP SDP RTP/AVP stream handler",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
|
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -28,12 +28,12 @@
|
|||||||
#include <pjsip_ua.h>
|
#include <pjsip_ua.h>
|
||||||
#include <pjlib.h>
|
#include <pjlib.h>
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
#include "asterisk/datastore.h"
|
#include "asterisk/datastore.h"
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/logger.h"
|
#include "asterisk/logger.h"
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/astobj2.h"
|
#include "asterisk/astobj2.h"
|
||||||
#include "asterisk/lock.h"
|
#include "asterisk/lock.h"
|
||||||
#include "asterisk/uuid.h"
|
#include "asterisk/uuid.h"
|
||||||
@@ -2125,7 +2125,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "SIP Session resource",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "PJSIP Session resource",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
@@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_sip_session</depend>
|
<depend>res_pjsip_session</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
|
|
||||||
@@ -45,8 +45,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
#include "asterisk/channel.h"
|
#include "asterisk/channel.h"
|
||||||
#include "asterisk/acl.h"
|
#include "asterisk/acl.h"
|
||||||
|
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
|
|
||||||
/*! \brief The number of seconds after receiving a T.38 re-invite before automatically rejecting it */
|
/*! \brief The number of seconds after receiving a T.38 re-invite before automatically rejecting it */
|
||||||
#define T38_AUTOMATIC_REJECTION_SECONDS 5
|
#define T38_AUTOMATIC_REJECTION_SECONDS 5
|
||||||
@@ -846,7 +846,7 @@ end:
|
|||||||
return AST_MODULE_LOAD_FAILURE;
|
return AST_MODULE_LOAD_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP T.38 UDPTL Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP T.38 UDPTL Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
|
.load_pri = AST_MODPRI_CHANNEL_DRIVER,
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
/*** MODULEINFO
|
/*** MODULEINFO
|
||||||
<depend>pjproject</depend>
|
<depend>pjproject</depend>
|
||||||
<depend>res_sip</depend>
|
<depend>res_pjsip</depend>
|
||||||
<depend>res_http_websocket</depend>
|
<depend>res_http_websocket</depend>
|
||||||
<support_level>core</support_level>
|
<support_level>core</support_level>
|
||||||
***/
|
***/
|
||||||
@@ -34,8 +34,8 @@
|
|||||||
|
|
||||||
#include "asterisk/module.h"
|
#include "asterisk/module.h"
|
||||||
#include "asterisk/http_websocket.h"
|
#include "asterisk/http_websocket.h"
|
||||||
#include "asterisk/res_sip.h"
|
#include "asterisk/res_pjsip.h"
|
||||||
#include "asterisk/res_sip_session.h"
|
#include "asterisk/res_pjsip_session.h"
|
||||||
#include "asterisk/taskprocessor.h"
|
#include "asterisk/taskprocessor.h"
|
||||||
|
|
||||||
static int transport_type_ws;
|
static int transport_type_ws;
|
||||||
@@ -395,7 +395,7 @@ static int unload_module(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP WebSocket Transport Support",
|
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP WebSocket Transport Support",
|
||||||
.load = load_module,
|
.load = load_module,
|
||||||
.unload = unload_module,
|
.unload = unload_module,
|
||||||
.load_pri = AST_MODPRI_APP_DEPEND,
|
.load_pri = AST_MODPRI_APP_DEPEND,
|
Reference in New Issue
Block a user