37 return rdata->msg_info.ctype
38 && !pj_strcmp2(&rdata->msg_info.ctype->media.type,
"application")
39 && !pj_strcmp2(&rdata->msg_info.ctype->media.subtype, subtype);
43 struct pjsip_rx_data *rdata,
int code)
48 if (pjsip_dlg_create_response(dlg, rdata, code,
49 NULL, &tdata) == PJ_SUCCESS) {
50 struct pjsip_transaction *tsx = pjsip_rdata_get_tsx(rdata);
51 pjsip_dlg_send_response(dlg, tsx, tdata);
59 if (*c ==
'!' || *c ==
'*' || *c ==
'#' ||
60 (
'A' <= *c && *c <=
'D') ||
61 (
'a' <= *c && *c <=
'd')) {
65 if ((sscanf(c,
"%30u", &event) != 1) || event > 16) {
79 return 'A' + (
event - 12);
84 pjsip_msg_body *body = rdata->msg_info.msg->body;
85 char buf[body ? body->len + 1 : 1];
89 unsigned int duration = 100;
90 char is_dtmf, is_dtmf_relay, is_flash;
101 if (!is_flash && !is_dtmf && !is_dtmf_relay) {
105 if (!body || !body->len) {
111 res = body->print_body(body, buf, body->len);
121 }
else if (is_dtmf_relay) {
122 while ((line =
strsep(&cur,
"\r\n"))) {
125 if (!(c = strchr(line,
'='))) {
132 if (!strcasecmp(line,
"signal")) {
136 }
else if (!strcasecmp(line,
"duration")) {
137 sscanf(c,
"%30u", &duration);
142 if (
event ==
'!' || is_flash) {
145 }
else if (
event !=
'\0') {
181 .requires =
"res_pjsip,res_pjsip_session",
Asterisk main include file. File version handling, generic pbx functions.
static int load_module(void)
static char get_event(const char *c)
static struct ast_sip_session_supplement dtmf_info_supplement
void ast_sip_session_unregister_supplement(struct ast_sip_session_supplement *supplement)
Unregister a an supplement to SIP session processing.
struct pjsip_inv_session * inv_session
A structure describing a SIP session.
struct ast_frame_subclass subclass
static struct ast_mansession session
struct ast_channel * channel
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f)
Queue one or more frames to a channel's frame queue.
static int is_media_type(pjsip_rx_data *rdata, char *subtype)
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
A supplement to SIP message processing.
char * strsep(char **str, const char *delims)
static int unload_module(void)
Data structure associated with a single frame of data.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static void send_response(struct ast_sip_session *session, struct pjsip_rx_data *rdata, int code)
#define ast_sip_session_register_supplement(supplement)