diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-30 18:48:30 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-04-30 18:48:30 +0000 |
commit | 922e673bf528a57a715fa2f6a65dd2faa8a54db9 (patch) | |
tree | 537e97d98720ee1380b24a549212ada8d4e37000 | |
parent | e4e2b456fd8209984677921f2f73919d62aabb92 (diff) |
Make mimetype for NOTIFY configurable
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@937 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | channels/chan_sip.c | 6 | ||||
-rwxr-xr-x | configs/sip.conf.sample | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2488bd543..919a1fd3c 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -91,6 +91,8 @@ static char callerid[AST_MAX_EXTENSION] = "asterisk"; static char fromdomain[AST_MAX_EXTENSION] = ""; +static char notifymime[AST_MAX_EXTENSION] = "application/simple-message-summary"; + static int usecnt =0; static pthread_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER; @@ -2472,7 +2474,7 @@ static int transmit_notify(struct sip_pvt *p, int newmsgs, int oldmsgs) char clen[20]; initreqprep(&req, p, "NOTIFY", NULL); add_header(&req, "Event", "message-summary"); - add_header(&req, "Content-Type", "application/simple-message-summary"); + add_header(&req, "Content-Type", notifymime); snprintf(tmp, sizeof(tmp), "Message-Waiting: %s\n", newmsgs ? "yes" : "no"); snprintf(tmp2, sizeof(tmp2), "Voicemail: %d/%d\n", newmsgs, oldmsgs); @@ -5129,6 +5131,8 @@ static int reload_config(void) ast_log(LOG_WARNING, "Unknown dtmf mode '%s', using rfc2833\n", v->value); globaldtmfmode = SIP_DTMF_RFC2833; } + } else if (!strcasecmp(v->name, "notifymimetype")) { + strncpy(notifymime, v->value, sizeof(notifymime) - 1); } else if (!strcasecmp(v->name, "language")) { strncpy(language, v->value, sizeof(language)-1); } else if (!strcasecmp(v->name, "callerid")) { diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample index 55508be61..0010d4779 100755 --- a/configs/sip.conf.sample +++ b/configs/sip.conf.sample @@ -9,6 +9,7 @@ context = default ; Default for incoming calls ;tos=184 ;maxexpirey=3600 ; Max length of incoming registration we allow ;defaultexpirey=120 ; Default length of incoming/outoing registration +;notifymimetype=text/plain ; Allow overriding of mime type in NOTIFY ; ;register => 1234@mysipprovider.com ; Register with a SIP provider ;register => 2345@mysipprovider.com/1234 ; Register 2345 at sip provider as 1234 here. |