From 212d9d6b48d7e5a54b424b20e17fc9166e8e2687 Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Wed, 4 Apr 2007 23:45:54 +0000 Subject: [PATCH] Bring in few local changes from asterisk. --- .../files/patch-channels::chan_sip.c | 25 +++++++++++++++++++ .../files/patch-configs::Makefile.in | 10 ++++++++ 2 files changed, 35 insertions(+) create mode 100644 net/openpbx.org/files/patch-channels::chan_sip.c create mode 100644 net/openpbx.org/files/patch-configs::Makefile.in diff --git a/net/openpbx.org/files/patch-channels::chan_sip.c b/net/openpbx.org/files/patch-channels::chan_sip.c new file mode 100644 index 000000000000..b61076ccd2c6 --- /dev/null +++ b/net/openpbx.org/files/patch-channels::chan_sip.c @@ -0,0 +1,25 @@ +--- channels/chan_sip.c.orig Wed Apr 4 12:59:02 2007 ++++ channels/chan_sip.c Wed Apr 4 13:08:42 2007 +@@ -3711,6 +3711,8 @@ + opbx_mutex_unlock(&i->lock); + fmt = opbx_best_codec(tmp->nativeformats); + ++ pbx_builtin_setvar_helper(tmp, "SIP_CODEC_USED", opbx_getformatname(fmt)); ++ + if (title) + snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%04x", title, thread_safe_opbx_random() & 0xffff); + else if (strchr(i->fromdomain, ':')) +@@ -11450,6 +11452,13 @@ + username = p->authname; + secret = p->peersecret; + md5secret = p->peermd5secret; ++ } ++ /* No authentication. Try to get auth info from channel vars */ ++ if (opbx_strlen_zero(username)) ++ { ++ username = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_NAME"); ++ secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_SECRET"); ++ md5secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_MD5SECRET"); + } + if (opbx_strlen_zero(username)) /* We have no authentication */ + return -1; diff --git a/net/openpbx.org/files/patch-configs::Makefile.in b/net/openpbx.org/files/patch-configs::Makefile.in new file mode 100644 index 000000000000..c408cf5969fb --- /dev/null +++ b/net/openpbx.org/files/patch-configs::Makefile.in @@ -0,0 +1,10 @@ +--- configs/Makefile.in.orig Wed Apr 4 14:42:16 2007 ++++ configs/Makefile.in Wed Apr 4 14:42:37 2007 +@@ -742,6 +742,7 @@ + for samplefile in $(SAMPLES); \ + do \ + configfile=`basename $${samplefile} .sample`; \ ++ $(INSTALL) -m 0640 $${samplefile} $(DESTDIR)${opbxconfdir}/$${samplefile}; \ + if test ! -f $(DESTDIR)${opbxconfdir}/$${configfile}; \ + then \ + $(INSTALL) -m 0640 $${samplefile} $(DESTDIR)${opbxconfdir}/$${configfile}; \