From: <abe...@us...> - 2014-08-27 22:39:08
|
Revision: 6674 http://sourceforge.net/p/astlinux/code/6674 Author: abelbeck Date: 2014-08-27 22:39:01 +0000 (Wed, 27 Aug 2014) Log Message: ----------- kamailio, move database file to: /mnt/kd/kamailio/data/kamailio.sqlite Modified Paths: -------------- branches/1.0/package/kamailio/etc/kamailio-basic.cfg branches/1.0/package/kamailio/etc/kamailio.cfg branches/1.0/package/kamailio/kamailio.init branches/1.0/package/kamailio/kamailio.mk Modified: branches/1.0/package/kamailio/etc/kamailio-basic.cfg =================================================================== --- branches/1.0/package/kamailio/etc/kamailio-basic.cfg 2014-08-27 14:34:56 UTC (rev 6673) +++ branches/1.0/package/kamailio/etc/kamailio-basic.cfg 2014-08-27 22:39:01 UTC (rev 6674) @@ -71,7 +71,7 @@ # - database URL - used to connect to database server by modules such # as: auth_db, acc, usrloc, a.s.o. #!ifndef DBURL -#!define DBURL "sqlite:///mnt/kd/kamailio.sqlite3" +#!define DBURL "sqlite:///mnt/kd/kamailio/data/kamailio.sqlite3" #!endif #!endif #!define MULTIDOMAIN 0 Modified: branches/1.0/package/kamailio/etc/kamailio.cfg =================================================================== --- branches/1.0/package/kamailio/etc/kamailio.cfg 2014-08-27 14:34:56 UTC (rev 6673) +++ branches/1.0/package/kamailio/etc/kamailio.cfg 2014-08-27 22:39:01 UTC (rev 6674) @@ -109,7 +109,7 @@ # - database URL - used to connect to database server by modules such # as: auth_db, acc, usrloc, a.s.o. #!ifndef DBURL -#!define DBURL "sqlite:///mnt/kd/kamailio.sqlite3" +#!define DBURL "sqlite:///mnt/kd/kamailio/data/kamailio.sqlite3" #!endif #!endif #!ifdef WITH_MULTIDOMAIN Modified: branches/1.0/package/kamailio/kamailio.init =================================================================== --- branches/1.0/package/kamailio/kamailio.init 2014-08-27 14:34:56 UTC (rev 6673) +++ branches/1.0/package/kamailio/kamailio.init 2014-08-27 22:39:01 UTC (rev 6674) @@ -9,8 +9,11 @@ if [ -f /etc/kamailio/kamctlrc ]; then . /etc/kamailio/kamctlrc fi - db_path="${DB_PATH:-/mnt/kd/kamailio.sqlite3}" + db_path="${DB_PATH:-/mnt/kd/kamailio/data/kamailio.sqlite3}" + if [ -d /mnt/kd/kamailio/data ]; then + chown kamailio:kamailio /mnt/kd/kamailio/data + fi if [ -f "$db_path" ]; then chown kamailio:kamailio "$db_path" fi @@ -28,6 +31,10 @@ exit fi + if [ ! -d /mnt/kd/kamailio/data ]; then + mkdir /mnt/kd/kamailio/data + chown kamailio:kamailio /mnt/kd/kamailio/data + fi if [ ! -d /mnt/kd/kamailio/certs ]; then mkdir /mnt/kd/kamailio/certs chown kamailio:kamailio /mnt/kd/kamailio/certs Modified: branches/1.0/package/kamailio/kamailio.mk =================================================================== --- branches/1.0/package/kamailio/kamailio.mk 2014-08-27 14:34:56 UTC (rev 6673) +++ branches/1.0/package/kamailio/kamailio.mk 2014-08-27 22:39:01 UTC (rev 6674) @@ -74,7 +74,7 @@ rm -rf $(TARGET_DIR)/etc/kamailio rsync -a --exclude=".svn" package/kamailio/etc/ $(TARGET_DIR)/stat/etc/kamailio/ $(SED) 's:^[# ]*DBENGINE=.*$$:DBENGINE=SQLITE:' \ - -e 's:^[# ]*DB_PATH=.*$$:DB_PATH="/mnt/kd/kamailio.sqlite3":' \ + -e 's:^[# ]*DB_PATH=.*$$:DB_PATH="/mnt/kd/kamailio/data/kamailio.sqlite3":' \ -e 's:^[# ]*PID_FILE=.*$$:PID_FILE="/var/run/kamailio/kamailio.pid":' \ -e 's:^[# ]*STARTOPTIONS=.*$$:STARTOPTIONS="-u kamailio -g kamailio":' \ $(TARGET_DIR)/stat/etc/kamailio/kamctlrc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-08-28 04:32:12
|
Revision: 6676 http://sourceforge.net/p/astlinux/code/6676 Author: abelbeck Date: 2014-08-28 04:32:04 +0000 (Thu, 28 Aug 2014) Log Message: ----------- kamailio, set the 'modules' path to: /usr/lib/kamailio/modules/ Modified Paths: -------------- branches/1.0/package/kamailio/etc/kamailio-basic.cfg branches/1.0/package/kamailio/etc/kamailio.cfg branches/1.0/package/kamailio/kamailio.mk Modified: branches/1.0/package/kamailio/etc/kamailio-basic.cfg =================================================================== --- branches/1.0/package/kamailio/etc/kamailio-basic.cfg 2014-08-28 03:48:05 UTC (rev 6675) +++ branches/1.0/package/kamailio/etc/kamailio-basic.cfg 2014-08-28 04:32:04 UTC (rev 6676) @@ -138,7 +138,7 @@ #!ifdef WITH_SRCPATH mpath="modules_k:modules" #!else -mpath="/lib/kamailio/modules/" +mpath="/usr/lib/kamailio/modules/" #!endif #!ifdef WITH_SQLITE Modified: branches/1.0/package/kamailio/etc/kamailio.cfg =================================================================== --- branches/1.0/package/kamailio/etc/kamailio.cfg 2014-08-28 03:48:05 UTC (rev 6675) +++ branches/1.0/package/kamailio/etc/kamailio.cfg 2014-08-28 04:32:04 UTC (rev 6676) @@ -209,7 +209,7 @@ #!ifdef WITH_SRCPATH mpath="modules/" #!else -mpath="/lib/kamailio/modules/" +mpath="/usr/lib/kamailio/modules/" #!endif #!ifdef WITH_SQLITE Modified: branches/1.0/package/kamailio/kamailio.mk =================================================================== --- branches/1.0/package/kamailio/kamailio.mk 2014-08-28 03:48:05 UTC (rev 6675) +++ branches/1.0/package/kamailio/kamailio.mk 2014-08-28 04:32:04 UTC (rev 6676) @@ -38,12 +38,12 @@ cfg_dir=etc/kamailio/ \ data_dir=usr/share/kamailio \ lib_dir=usr/lib/kamailio \ - module_dir=usr/lib/kamailio \ cfg_target=/etc/kamailio/ \ group_include="$(KAMAILIO_GROUP_MODULES)" \ include_modules="$(KAMAILIO_INCLUDE_MODULES)" \ exclude_modules="$(KAMAILIO_EXCLUDE_MODULES)" \ modules_dirs="modules" \ + LIBDIR=usr/lib \ ARCH="i386" \ OS="linux" @@ -86,7 +86,6 @@ define KAMAILIO_UNINSTALL_TARGET_CMDS rm -f $(TARGET_DIR)/usr/sbin/kamailio - rm -rf $(TARGET_DIR)/lib/kamailio rm -rf $(TARGET_DIR)/usr/lib/kamailio rm -rf $(TARGET_DIR)/usr/share/kamailio rm -rf $(TARGET_DIR)/stat/etc/kamailio This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2014-08-29 23:41:20
|
Revision: 6678 http://sourceforge.net/p/astlinux/code/6678 Author: abelbeck Date: 2014-08-29 23:41:17 +0000 (Fri, 29 Aug 2014) Log Message: ----------- kamailio, add WITH_ASTERISK switch to the kamailio.cfg, still work in progress, add 'uac' module Ref: http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb Modified Paths: -------------- branches/1.0/package/kamailio/etc/kamailio.cfg branches/1.0/package/kamailio/kamailio.mk Modified: branches/1.0/package/kamailio/etc/kamailio.cfg =================================================================== --- branches/1.0/package/kamailio/etc/kamailio.cfg 2014-08-28 18:37:53 UTC (rev 6677) +++ branches/1.0/package/kamailio/etc/kamailio.cfg 2014-08-29 23:41:17 UTC (rev 6678) @@ -80,6 +80,13 @@ # - set the value of voicemail.srv_ip # - adjust the value of voicemail.srv_port # +# *** To enable Asterisk routing execute: +# - define WITH_ASTERISK +# - set the value of asterisk.bindip +# - adjust the value of asterisk.bindport +# - set the value of kamailio.bindip +# - adjust the value of kamailio.bindport +# # *** To enhance accounting execute: # - enable sqlite # - define WITH_ACCDB @@ -203,6 +210,13 @@ voicemail.srv_port = "5060" desc "VoiceMail Port" #!endif +#!ifdef WITH_ASTERISK +asterisk.bindip = "127.0.0.1" desc "Asterisk IP Address" +asterisk.bindport = "5080" desc "Asterisk Port" +kamailio.bindip = "127.0.0.1" desc "Kamailio IP Address" +kamailio.bindport = "5060" desc "Kamailio Port" +#!endif + ####### Modules Section ######## # set paths to location of modules (to sources or installation folders) @@ -285,6 +299,10 @@ loadmodule "debugger.so" #!endif +#!ifdef WITH_ASTERISK +loadmodule "uac.so" +#!endif + # ----------------- setting module-specific parameters --------------- @@ -310,7 +328,11 @@ # add value to ;lr param to cope with most of the UAs modparam("rr", "enable_full_lr", 1) # do not append from tag to the RR (no need for this script) +#!ifdef WITH_ASTERISK +modparam("rr", "append_fromtag", 1) +#!else modparam("rr", "append_fromtag", 0) +#!endif # ----- registrar params ----- @@ -363,11 +385,19 @@ # ----- auth_db params ----- #!ifdef WITH_AUTH +modparam("auth_db", "calculate_ha1", yes) +modparam("auth_db", "load_credentials", "") + +##!ifdef WITH_ASTERISK +#modparam("auth_db", "user_column", "name") +#modparam("auth_db", "password_column", "sippasswd") +#modparam("auth_db", "db_url", DBASTURL) +#modparam("auth_db", "version_table", 0) +##!else modparam("auth_db", "db_url", DBURL) -modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "password_column", "password") -modparam("auth_db", "load_credentials", "") modparam("auth_db", "use_domain", MULTIDOMAIN) +##!endif # ----- permissions params ----- #!ifdef WITH_IPAUTH @@ -638,6 +668,10 @@ if (!save("location")) sl_reply_error(); +#!ifdef WITH_ASTERISK + route(REGFWD); +#!endif + exit; } } @@ -658,6 +692,16 @@ route(SIPOUT); #!endif +#!ifdef WITH_ASTERISK + if(is_method("INVITE") && (!route(FROMASTERISK))) { + # if new call from out there - send to Asterisk + # - non-INVITE request are routed directly by Kamailio + # - traffic from Asterisk is routed also directy by Kamailio + route(TOASTERISK); + exit; + } +#!endif + $avp(oexten) = $rU; if (!lookup("location")) { $var(rc) = $rc; @@ -725,8 +769,23 @@ # Authentication route route[AUTH] { + + # if caller is not local subscriber, then check if it calls + # a local destination, otherwise deny, not an open relay here + if (from_uri!=myself && uri!=myself) + { + sl_send_reply("403","Not relaying"); + exit; + } + #!ifdef WITH_AUTH +#!ifdef WITH_ASTERISK + # do not auth traffic from Asterisk - trusted! + if(route(FROMASTERISK)) + return; +#!endif + #!ifdef WITH_IPAUTH if((!is_method("REGISTER")) && allow_source_address()) { @@ -738,7 +797,11 @@ if (is_method("REGISTER") || from_uri==myself) { # authenticate requests +##!ifdef WITH_ASTERISK +# if (!auth_check("$fd", "sipusers", "1")) { +##!else if (!auth_check("$fd", "subscriber", "1")) { +##!endif auth_challenge("$fd", "0"); exit; } @@ -746,14 +809,6 @@ if(!is_method("REGISTER|PUBLISH")) consume_credentials(); } - # if caller is not local subscriber, then check if it calls - # a local destination, otherwise deny, not an open relay here - if (from_uri!=myself && uri!=myself) - { - sl_send_reply("403","Not relaying"); - exit; - } - #!endif return; } @@ -948,3 +1003,43 @@ } #!endif } + +#!ifdef WITH_ASTERISK +# Test if coming from Asterisk +route[FROMASTERISK] { + if($si==$sel(cfg_get.asterisk.bindip) + && $sp==$sel(cfg_get.asterisk.bindport)) + return 1; + return -1; +} + +# Send to Asterisk +route[TOASTERISK] { + $du = "sip:" + $sel(cfg_get.asterisk.bindip) + ":" + + $sel(cfg_get.asterisk.bindport); + route(RELAY); + exit; +} + +# Forward REGISTER to Asterisk +route[REGFWD] { + if(!is_method("REGISTER")) + { + return; + } + $var(rip) = $sel(cfg_get.asterisk.bindip); + $uac_req(method)="REGISTER"; + $uac_req(ruri)="sip:" + $var(rip) + ":" + $sel(cfg_get.asterisk.bindport); + $uac_req(furi)="sip:" + $au + "@" + $var(rip); + $uac_req(turi)="sip:" + $au + "@" + $var(rip); + $uac_req(hdrs)="Contact: <sip:" + $au + "@" + + $sel(cfg_get.kamailio.bindip) + + ":" + $sel(cfg_get.kamailio.bindport) + ">\r\n"; + if($sel(contact.expires) != $null) + $uac_req(hdrs)= $uac_req(hdrs) + "Expires: " + $sel(contact.expires) + "\r\n"; + else + $uac_req(hdrs)= $uac_req(hdrs) + "Expires: " + $hdr(Expires) + "\r\n"; + uac_req_send(); +} +#!endif + Modified: branches/1.0/package/kamailio/kamailio.mk =================================================================== --- branches/1.0/package/kamailio/kamailio.mk 2014-08-28 18:37:53 UTC (rev 6677) +++ branches/1.0/package/kamailio/kamailio.mk 2014-08-29 23:41:17 UTC (rev 6678) @@ -10,7 +10,7 @@ KAMAILIO_DEPENDENCIES = openssl KAMAILIO_GROUP_MODULES = standard -KAMAILIO_INCLUDE_MODULES = acc htable outbound permissions registrar tls usrloc +KAMAILIO_INCLUDE_MODULES = acc htable outbound permissions registrar tls uac usrloc KAMAILIO_EXCLUDE_MODULES = rtpproxy-ng xhttp xhttp_rpc ifeq ($(strip $(BR2_PACKAGE_SQLITE)),y) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abe...@us...> - 2015-12-20 17:10:06
|
Revision: 7416 http://sourceforge.net/p/astlinux/code/7416 Author: abelbeck Date: 2015-12-20 17:10:03 +0000 (Sun, 20 Dec 2015) Log Message: ----------- kamailio, version bump to 4.1.9 Modified Paths: -------------- branches/1.0/package/kamailio/kamailio-sqlite-concat-fix.patch branches/1.0/package/kamailio/kamailio.mk Modified: branches/1.0/package/kamailio/kamailio-sqlite-concat-fix.patch =================================================================== --- branches/1.0/package/kamailio/kamailio-sqlite-concat-fix.patch 2015-12-17 15:50:19 UTC (rev 7415) +++ branches/1.0/package/kamailio/kamailio-sqlite-concat-fix.patch 2015-12-20 17:10:03 UTC (rev 7416) @@ -20,7 +20,7 @@ AS 'SIP-ID' FROM $DA_TABLE $CLAUSE ; " $DBROCMD "$QUERY" #TMP_UUID=`sql_ro_query "$QUERY" | $AWK 'BEGIN {line=0;} -@@ -1970,7 +1970,7 @@ +@@ -1973,7 +1973,7 @@ $SD_DOMAIN_COLUMN='$OSERDOMAIN'" mecho "Dumping speed-dials for user=<$2>" echo @@ -29,7 +29,7 @@ $SD_SD_DOMAIN_COLUMN) AS 'Short number', $SD_NEW_URI_COLUMN AS 'New URI',\ $SD_DESC_COLUMN FROM $SD_TABLE $CLAUSE;" $DBROCMD "$QUERY" -@@ -1996,8 +1996,8 @@ +@@ -1999,8 +1999,8 @@ else exit 1 fi @@ -40,7 +40,7 @@ $SD_DOMAIN_COLUMN) AS 'Owner', $SD_NEW_URI_COLUMN AS 'New URI',\ $SD_DESC_COLUMN FROM $SD_TABLE;" $DBROCMD "$QUERY" -@@ -2039,7 +2039,7 @@ +@@ -2042,7 +2042,7 @@ CLAUSE="WHERE $SD_SD_USER_COLUMN='$OSERUSER' AND \ $SD_SD_DOMAIN_COLUMN='$OSERDOMAIN'" Modified: branches/1.0/package/kamailio/kamailio.mk =================================================================== --- branches/1.0/package/kamailio/kamailio.mk 2015-12-17 15:50:19 UTC (rev 7415) +++ branches/1.0/package/kamailio/kamailio.mk 2015-12-20 17:10:03 UTC (rev 7416) @@ -4,7 +4,7 @@ # ############################################################## -KAMAILIO_VERSION = 4.1.8 +KAMAILIO_VERSION = 4.1.9 KAMAILIO_SOURCE = kamailio-$(KAMAILIO_VERSION)_src.tar.gz KAMAILIO_SITE = http://kamailio.org/pub/kamailio/$(KAMAILIO_VERSION)/src KAMAILIO_DEPENDENCIES = openssl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |