From: Michael Geddes Date: Sat, 17 Jan 2009 11:07:52 +0000 (+0000) Subject: Add DisplayName option to sip/iax for callerid display X-Git-Tag: 0.9.0~783 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2c79f6771cd5bbf7a8503e164b8ad7f13f0aab14;p=oweals%2Fluci.git Add DisplayName option to sip/iax for callerid display --- diff --git a/contrib/package/asterisk-xip/files/uci/sipiaxconf b/contrib/package/asterisk-xip/files/uci/sipiaxconf index 30af55e56..6074086d1 100755 --- a/contrib/package/asterisk-xip/files/uci/sipiaxconf +++ b/contrib/package/asterisk-xip/files/uci/sipiaxconf @@ -23,6 +23,7 @@ check_append_local() { eval "dialplan_local_${1}_context=\"${2}\"" eval "dialplan_local_${1}_selfmailbox=\"${3}\"" eval "dialplan_local_${1}_mailbox=\"${4}\"" + eval "dialplan_local_${1}_displayname=\"${5}\"" return 0 else return 1 @@ -31,7 +32,7 @@ check_append_local() { append_dialplan_locals(){ for i in ${dialplan_locals} ; do local extension=$i - for x in context selfmailbox mailbox ; do + for x in context selfmailbox mailbox displayname ; do eval "x_${x}=\${dialplan_local_${i}_${x}}" done local newcontext=local_${extension} @@ -43,6 +44,7 @@ append_dialplan_locals(){ # add_dialplan_include ${newcontext} ${x_last_context} append_dialplan_context ${newcontext} "exten => ${match_all},1,Set(CALLERID(num)=${extension})" + [ -z "${x_displayname}" ] || append_dialplan_context ${newcontext} "exten => ${match_all},1,Set(CALLERID(name)=${x_displayname})" if [ ! -z "${x_mailbox}" ] ; then [ "${x_selfmailbox}" = "yes" ] && append_dialplan_context ${newcontext} "exten => ${extension},2,VoiceMailMain(${x_mailbox})" [ ! -z "${dialplan_voiceboxext}" ] && append_dialplan_context ${newcontext} "exten => ${dialplan_voiceboxext},2,VoiceMailMain(${x_mailbox})" @@ -72,14 +74,14 @@ check_add_iaxitems() { do_check_add_items(){ - for i in type last_host last_context selfmailbox last_extension last_mailbox ; do + for i in type last_host last_context selfmailbox last_extension last_mailbox last_displayname ; do eval "x_${i}=\"\${${1}_${i}-}\"" done if [ ! -z "${x_last_context}" ] ; then if [ ! -z "${x_last_extension}" ] ; then [ "${x_last_context}" = "-" ] && eval "x_last_context=\"\${${1}_opt_context}\"" - check_append_local "${x_last_extension}" "${x_last_context}" "${x_selfmailbox}" "${x_last_mailbox}" + check_append_local "${x_last_extension}" "${x_last_context}" "${x_selfmailbox}" "${x_last_mailbox}" "${x_last_displayname}" x_last_context=local_${x_last_extension} fi if [ "${x_last_context}" != "-" ] ; then @@ -91,7 +93,8 @@ do_check_add_items(){ fi for i in last_username last_fromdomain last_secret last_username \ - sectionname last_fromuser last_context last_extension last_mailbox last_type last_host ; do + sectionname last_fromuser last_context last_extension last_mailbox \ + last_type last_host last_displayname ; do eval unset $1_$i done @@ -337,7 +340,7 @@ handle_sip() { append sip_sections "$1=$2" "$N" ;; register) [ "$2" == "yes" ] && sip_doregister=1 ;; - registerextension) eval sip_last_$1="$2";; + registerextension|displayname) eval sip_last_$1="$2";; allow|allow_ITEM*) split_append sip_sections allow= "$2" "${N}" enable_format ;; extension|extension_ITEM*) add_extension SIP ${sip_sectionname} "$2" ;; @@ -460,6 +463,7 @@ handle_iax() { split_append iax_sections allow= "$2" "${N}" enable_format ;; extension_LENGTH) ;; extension|extension_ITEM*) add_extension IAX ${iax_sectionname} "$2" ;; + displayname) eval iax_last_$1="$2";; context) eval iax_last_context="$2" ;; selfmailbox) diff --git a/contrib/package/asterisk-xip/files/uci/sipiaxconf.txt b/contrib/package/asterisk-xip/files/uci/sipiaxconf.txt index 64883515f..8e166595b 100644 --- a/contrib/package/asterisk-xip/files/uci/sipiaxconf.txt +++ b/contrib/package/asterisk-xip/files/uci/sipiaxconf.txt @@ -5,6 +5,7 @@ target (SIP|IAX)_{name} - Handle options for outgoing dialing internationalprefix- Prefix required to dial internation on this target alwaysinternational- True if this target always requires internation prefix countrycode - Default International country code for this target + displayname - CallerID Name to set. sipgeneral sip [sip_]{name}