From ecea9a647173b35594618f43ee1220f0703e8586 Mon Sep 17 00:00:00 2001 From: Abdulkarim Barbour <63456208+NUCLEAR-WAR@users.noreply.github.com> Date: Wed, 1 Jan 2025 01:21:49 +0100 Subject: [PATCH 01/14] moving Session termination to its own block moving Session termination to its own block --- pcscf/route/mo.cfg | 89 +++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/pcscf/route/mo.cfg b/pcscf/route/mo.cfg index ffc9b31..dc8f986 100644 --- a/pcscf/route/mo.cfg +++ b/pcscf/route/mo.cfg @@ -339,28 +339,11 @@ onreply_route[MO_reply] { # Terminating N5 AppSession after BYE - if (is_method("BYE|CANCEL") || status=~"[45][0-9][0-9]") { - xlog("L_ALERT", "Terminating AppSession for Call fom User $fU due to call END or Call Failed\n"); - # Retrieve the AppSession Id from the hash table - $var(user_id_midcall_rel) = $fU; - $var(user_appsess_midcall_rel) = $sht(user_data=>$var(user_id_midcall_rel)); - xlog("L_INFO", "Terminating stored AppSession for user $var(user_id_midcall_rel): $var(user_appsess_midcall_rel)\n"); - - $var(headers) = "X-SIP-Status: De-Registration\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n"; - $var(headers) = $var(headers) + "accept: application/json\r\n"; - $var(headers) = $var(headers) + "accept: application/problem+json\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now); - - http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_midcall_rel)/delete", "$var(json_request)", "$var(headers)", "$var(result)" ); - xlog("L_INFO", "Termination resuts: $var(result)\n"); - xlog("L_INFO", "response header: $curlerror(error)\n"); - xlog("L_INFO", "response header: $var(response_code)\n"); - xlog("L_INFO", "response header: $httprhdr(location)\n"); - xlog("L_INFO", "response header: $rc\n"); - } + if(is_method("BYE|CANCEL")) + { + route(N5_MOC_TERM); + + } #!endif #!ifdef WITH_IPSEC @@ -424,28 +407,10 @@ route[MO_indialog] { } # Terminating N5 AppSession after BYE - if (is_method("BYE|CANCEL")) { - xlog("L_ALERT","Terminating AppSession for Call from User $fU due to call END or Call Failed\n"); - # Retrieve the AppSession Id from the hash table - $var(user_id_call_rel) = $fU; - $var(user_appsess_call_rel) = $sht(user_data=>$var(user_id_call_rel)); - xlog("L_INFO", "Terminating stored AppSession for user $var(user_id_call_rel): $var(user_id_call_rel)\n"); - - $var(headers) = "X-SIP-Status: De-Registration\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n"; - $var(headers) = $var(headers) + "accept: application/json\r\n"; - $var(headers) = $var(headers) + "accept: application/problem+json\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now); - - http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_call_rel)/delete", "$var(json_request)", "$var(headers)", "$var(result)" ); - xlog("L_INFO", "Termination resuls: $var(result)\n"); - xlog("L_INFO", "response header: $curlerror(error)\n"); - xlog("L_INFO", "response header: $var(response_code)\n"); - xlog("L_INFO", "response header: $httprhdr(location)\n"); - xlog("L_INFO", "response header: $rc\n"); - } + if(is_method("BYE|CANCEL")) + { + route(N5_MOC_TERM); + } #!endif xnotice("PCSCF MO_indialog: \n Destination URI: $du\n Request URI: $ru\n"); @@ -532,7 +497,6 @@ route[MO_indialog_aar_reply] } #!ifdef WITH_N5 - # 5G VoNR N5 Policy Authorization PATCH request route[N5_PATCH_REQ] { xlog("L_INFO", "IMS: Received 183/200 inside orig_initial_reply\n"); @@ -669,3 +633,38 @@ route[N5_PATCH_REQ] { } } #!endif + +#!ifdef WITH_N5 +route[N5_MOC_TERM] { + + # Retrieving and paying attention to whom ended the call + $var(user_id_call_rel) = $fU; # User Part of the from Header to get the USER + $var(user_appsess_call_rel) = $sht(user_data=>$var(user_id_call_rel)); + if $var(user_appsess_call_rel) == 0 { + xlog("L_INFO", "we dont have AppSessionID to terminate, doing alternative Method\n"); + + # Retrieving and paying attention to whom ended the call + $var(user_id_call_rel) = $tU; # User Part of the from Header to get the USER + $var(user_appsess_call_rel) = $sht(user_data=>$var(user_id_call_rel)); + xlog("L_INFO", "Alt-Method : Terminating Stored AppSession for user $var(user_id_call_rel): $var(user_appsess_call_rel)\n"); + } else { + xlog("L_INFO", "We have AppSessionID, doing normal Method\n"); + xlog("L_INFO", "Normal Method : Stored MOC AppSession for user $var(user_id_call_rel): $var(user_appsess_call_rel)\n"); + } + + $var(headers) = "X-SIP-Status: Call-Termination\r\n"; + $var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n"; + $var(headers) = $var(headers) + "accept: application/json\r\n"; + $var(headers) = $var(headers) + "accept: application/problem+json\r\n"; + $var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n"; + $var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n"; + $var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now); + + http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_call_rel)/delete", "$var(json_request)", "$var(headers)", "$var(result)" ); + xlog("L_INFO", "Termination resuls: $var(result)\n"); + xlog("L_INFO", "response header: $curlerror(error)\n"); + xlog("L_INFO", "response header: $var(response_code)\n"); + xlog("L_INFO", "response header: $httprhdr(location)\n"); + xlog("L_INFO", "response header: $rc\n"); +} +#!endif From 782cb31d36384f627b15c54098b414787363386d Mon Sep 17 00:00:00 2001 From: Abdulkarim Barbour <63456208+NUCLEAR-WAR@users.noreply.github.com> Date: Wed, 1 Jan 2025 01:37:34 +0100 Subject: [PATCH 02/14] add termination in case of cancel/error --- pcscf/route/mo.cfg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pcscf/route/mo.cfg b/pcscf/route/mo.cfg index dc8f986..18421f0 100644 --- a/pcscf/route/mo.cfg +++ b/pcscf/route/mo.cfg @@ -338,12 +338,12 @@ onreply_route[MO_reply] { } - # Terminating N5 AppSession after BYE - if(is_method("BYE|CANCEL")) - { +## Terminating N5 AppSession after CANCEL/ERROR## + if(is_method("CANCEL") || status=~"[45][0-9][0-9]"){ + xlog("L_ALERT", "Terminating AppSession For Call fom User $fU due to call END or Call Faild\n"); route(N5_MOC_TERM); - } + #!endif #!ifdef WITH_IPSEC From 26224258beb6b8826261ac2c139220396d104322 Mon Sep 17 00:00:00 2001 From: local_dev_user Date: Wed, 1 Jan 2025 02:02:41 +0000 Subject: [PATCH 03/14] Adding a kind-of IBCF and improve e164 lookup --- .env | 3 + ibcf/Dockerfile | 68 ++ ibcf/README.md | 5 + ibcf/config/acl.conf | 1 + ibcf/config/asterisk.conf | 13 + ibcf/config/cdr.conf | 7 + ibcf/config/cdr_custom.conf | 4 + ibcf/config/confbridge.conf | 1 + ibcf/config/extensions.conf | 176 +++++ ibcf/config/indications.conf | 18 + ibcf/config/logger.conf | 9 + ibcf/config/modules.conf | 130 ++++ ibcf/config/musiconhold.conf | 5 + ibcf/config/pjsip.conf | 148 ++++ ibcf/config/pjsip_notify.conf | 57 ++ ibcf/config/queues.conf | 19 + ibcf/config/rtp.conf | 3 + ibcf/config/voicemail.conf | 17 + ibcf/menuselect.makedeps | 234 ++++++ ibcf/menuselect.makeopts | 122 +++ ibcf/start-asterisk.sh | 16 + sa-vonr-deploy.yaml | 23 + scscf/scscf/CxDataType_Rel6.xsd | 293 +++++++ scscf/scscf/CxDataType_Rel7.xsd | 301 ++++++++ scscf/scscf/CxDataType_Rel8.xsd | 379 +++++++++ scscf/scscf/dispatcher.list | 1 + scscf/scscf/kamailio_scscf.cfg | 1276 +++++++++++++++++++++++++++++++ scscf/scscf/scscf.cfg | 84 ++ scscf/scscf/scscf.xml | 36 + scscf/scscf/scscf_init.sh | 80 ++ 30 files changed, 3529 insertions(+) create mode 100644 ibcf/Dockerfile create mode 100644 ibcf/README.md create mode 100644 ibcf/config/acl.conf create mode 100644 ibcf/config/asterisk.conf create mode 100644 ibcf/config/cdr.conf create mode 100644 ibcf/config/cdr_custom.conf create mode 100644 ibcf/config/confbridge.conf create mode 100644 ibcf/config/extensions.conf create mode 100644 ibcf/config/indications.conf create mode 100644 ibcf/config/logger.conf create mode 100644 ibcf/config/modules.conf create mode 100644 ibcf/config/musiconhold.conf create mode 100644 ibcf/config/pjsip.conf create mode 100644 ibcf/config/pjsip_notify.conf create mode 100644 ibcf/config/queues.conf create mode 100644 ibcf/config/rtp.conf create mode 100644 ibcf/config/voicemail.conf create mode 100644 ibcf/menuselect.makedeps create mode 100644 ibcf/menuselect.makeopts create mode 100755 ibcf/start-asterisk.sh create mode 100644 scscf/scscf/CxDataType_Rel6.xsd create mode 100644 scscf/scscf/CxDataType_Rel7.xsd create mode 100644 scscf/scscf/CxDataType_Rel8.xsd create mode 100644 scscf/scscf/dispatcher.list create mode 100644 scscf/scscf/kamailio_scscf.cfg create mode 100644 scscf/scscf/scscf.cfg create mode 100644 scscf/scscf/scscf.xml create mode 100755 scscf/scscf/scscf_init.sh diff --git a/.env b/.env index 38d5f28..baa3167 100644 --- a/.env +++ b/.env @@ -130,6 +130,9 @@ SRS_GNB_IP=172.22.0.37 # GRAFANA GRAFANA_IP=172.22.0.39 +# IBCF +IBCF_IP=172.22.0.140 + # UE IPv4 Subnet Range for APN=internet UE_IPV4_INTERNET=192.168.100.0/24 diff --git a/ibcf/Dockerfile b/ibcf/Dockerfile new file mode 100644 index 0000000..307f0d6 --- /dev/null +++ b/ibcf/Dockerfile @@ -0,0 +1,68 @@ +# syntax=docker/dockerfile:1 + +FROM debian:bullseye +# Install required packages +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y \ + lsb-release \ + ca-certificates \ + git \ + vim \ + wget \ + curl \ + openssh-server \ + net-tools \ + && apt-get clean +RUN apt --no-install-recommends --assume-yes install unzip autoconf automake build-essential pkg-config libedit-dev libjansson-dev libsqlite3-dev uuid-dev libxslt1-dev xmlstarlet \ + && apt clean + +# Download Asterisk source : +WORKDIR /usr/src +RUN git clone -b releases/22 https://github.com/asterisk/asterisk.git +# Adding EVS and AMR support +# First EVS +WORKDIR /usr/src/asterisk +# install additional DEBs required by Asterisk +RUN sh contrib/scripts/install_prereq install +RUN sh contrib/scripts/get_mp3_source.sh +RUN git clone https://github.com/NUCLEAR-WAR/asterisk-evs.git +RUN cp --verbose --recursive ./asterisk-evs*/* ./ +RUN patch -p0 <./codec_evs.patch +RUN wget www.etsi.org/deliver/etsi_ts/126400_126499/126443/16.01.00_60/ts_126443v160100p0.zip +RUN unzip -qq ts_126443v*.zip +RUN unzip -qq 26443-*-ANSI-C_source_code.zip +WORKDIR /usr/src/asterisk/c-code +RUN chmod +r ./lib_*/*.h +RUN mkdir /usr/include/3gpp-evs +RUN cp --verbose --target-directory=/usr/include/3gpp-evs ./lib_*/*.h +RUN DEBUG=0 RELEASE=1 CFLAGS='-DNDEBUG -fPIC' make +WORKDIR /usr/src/asterisk/c-code/build +RUN rm ./decoder.o +RUN cc -shared -o lib3gpp-evs.so *.o +RUN cp ./lib3gpp-evs.so /usr/lib/ +WORKDIR /usr/src/asterisk +RUN patch -p0 <./build_evs.patch +RUN patch -p0 <./force_limitations.patch + +# Now AMR +RUN apt --assume-yes install libopencore-amrnb-dev libopencore-amrwb-dev libvo-amrwbenc-dev +RUN wget github.com/traud/asterisk-amr/archive/master.zip +RUN unzip -qq master.zip +RUN rm master.zip +RUN cp --verbose --recursive ./asterisk-amr*/* ./ +RUN patch -p0 <./codec_amr.patch +RUN patch -p0 <./build_tools.patch + +# Run the bootstrap script to re-generate configure files and configure patched Asterisk: +RUN ./bootstrap.sh +RUN ./configure +COPY menuselect.makedeps . +COPY menuselect.makeopts . +RUN make && make install + +COPY config/* /etc/asterisk/ + +CMD ["/mnt/ibcf/start-asterisk.sh"] + + diff --git a/ibcf/README.md b/ibcf/README.md new file mode 100644 index 0000000..f0ab21b --- /dev/null +++ b/ibcf/README.md @@ -0,0 +1,5 @@ +This is a basic kind of IBCF based on Asterisk to handle calls from and to Docker_open5gs, I tried my best to do all the configs, but it still requires your adjustments. + +Please read the Comments carefully before starting the container, specially in : pjsip.conf, extenteions.conf and voiemail.conf, those files must be configured otherwise the IBCF will not work properly!! + +have fun Testing! diff --git a/ibcf/config/acl.conf b/ibcf/config/acl.conf new file mode 100644 index 0000000..7ebc71c --- /dev/null +++ b/ibcf/config/acl.conf @@ -0,0 +1 @@ +[ibcf_acl] \ No newline at end of file diff --git a/ibcf/config/asterisk.conf b/ibcf/config/asterisk.conf new file mode 100644 index 0000000..ff66cee --- /dev/null +++ b/ibcf/config/asterisk.conf @@ -0,0 +1,13 @@ +[options] +; If we want to start Asterisk with a default verbosity for the verbose +; or debug logger channel types, then we use these settings (by default +; they are disabled). +;verbose = 5 +;debug = 2 + +; User and group to run asterisk as. NOTE: This will require changes to +; directory and device permissions. +;runuser = asterisk ; The user to run as. The default is root. +;rungroup = asterisk ; The group to run as. The default is root + +;defaultlanguage = es diff --git a/ibcf/config/cdr.conf b/ibcf/config/cdr.conf new file mode 100644 index 0000000..e8749e3 --- /dev/null +++ b/ibcf/config/cdr.conf @@ -0,0 +1,7 @@ +[general] +enable=yes + +[custom] +; We log the unique ID as it can be useful for troubleshooting any issues +; that arise. +loguniqueid=yes diff --git a/ibcf/config/cdr_custom.conf b/ibcf/config/cdr_custom.conf new file mode 100644 index 0000000..12ad24f --- /dev/null +++ b/ibcf/config/cdr_custom.conf @@ -0,0 +1,4 @@ +[mappings] +; Our CDR log will be written to /var/log/asterisk/cdr-custom/Master.csv +; with the following schema. +Master.csv => ${CSV_QUOTE(${CDR(clid)})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)})},${CSV_QUOTE(${CDR(dcontext)})},${CSV_QUOTE(${CDR(channel)})},${CSV_QUOTE(${CDR(dstchannel)})},${CSV_QUOTE(${CDR(lastapp)})},${CSV_QUOTE(${CDR(lastdata)})},${CSV_QUOTE(${CDR(start)})},${CSV_QUOTE(${CDR(answer)})},${CSV_QUOTE(${CDR(end)})},${CSV_QUOTE(${CDR(duration)})},${CSV_QUOTE(${CDR(billsec)})},${CSV_QUOTE(${CDR(disposition)})},${CSV_QUOTE(${CDR(amaflags)})},${CSV_QUOTE(${CDR(accountcode)})},${CSV_QUOTE(${CDR(uniqueid)})},${CSV_QUOTE(${CDR(userfield)})},${CDR(sequence)} diff --git a/ibcf/config/confbridge.conf b/ibcf/config/confbridge.conf new file mode 100644 index 0000000..3a44e68 --- /dev/null +++ b/ibcf/config/confbridge.conf @@ -0,0 +1 @@ +; All conferences use default settings. This config must be present to load the confbridge application diff --git a/ibcf/config/extensions.conf b/ibcf/config/extensions.conf new file mode 100644 index 0000000..fbd847b --- /dev/null +++ b/ibcf/config/extensions.conf @@ -0,0 +1,176 @@ + +; extensions.conf - the Asterisk dial plan +; +; Static extension configuration file, used by +; the pbx_config module. This is where you configure all your +; inbound and outbound calls in Asterisk. +; +; This configuration file is reloaded +; - With the "dialplan reload" command in the CLI +; - With the "reload" command (that reloads everything) in the CLI + +; +; The "General" category is for certain variables. +; +[general] +; +; If static is set to no, or omitted, then the pbx_config will rewrite +; this file when extensions are modified. Remember that all comments +; made in the file will be lost when that happens. +; +; XXX Not yet implemented XXX +; +static=yes +; +; if static=yes and writeprotect=no, you can save dialplan by +; CLI command "dialplan save" too +; +writeprotect=yes +; +; If autofallthrough is set, then if an extension runs out of +; things to do, it will terminate the call with BUSY, CONGESTION +; or HANGUP depending on Asterisk's best guess. This is the default. +; +; If autofallthrough is not set, then if an extension runs out of +; things to do, Asterisk will wait for a new extension to be dialed +; (this is the original behavior of Asterisk 1.0 and earlier). +; +;autofallthrough=no +; +; +; +; If extenpatternmatchnew is set (true, yes, etc), then a new algorithm that uses +; Trie +extenpatternmatchnew=no +; +; If clearglobalvars is set, global variables will be cleared +; and reparsed on a dialplan reload, or Asterisk reload. +; +; If clearglobalvars is not set, then global variables will persist +; through reloads, and even if deleted from the extensions.conf or +; one of its included files, will remain set to the previous value. +; +; NOTE: A complication sets in, if you put your global variables into +; the AEL file, instead of the extensions.conf file. With clearglobalvars +; set, a "reload" will often leave the globals vars cleared, because it +; is not unusual to have extensions.conf (which will have no globals) +; load after the extensions.ael file (where the global vars are stored). +; So, with "reload" in this particular situation, first the AEL file will +; clear and then set all the global vars, then, later, when the extensions.conf +; file is loaded, the global vars are all cleared, and then not set, because +; they are not stored in the extensions.conf file. +; +clearglobalvars=yes +; +; User context is where entries from users.conf are registered. The +; default value is 'default' +; + + +; Welcome to Asterisk Dialplan!! its not complicated, you will get use to it in just a "few" tries +userscontext=unspecified + + +; Here are some deffined variables that will be used in the dialplan, some of them must be adjusted to your need! + +; I use a german Trunk so I have the +49, adjust depand on your country, this is used on incoming, as my provider sends only E164 numbers. +[globals] +INTERNAL_DIAL_OPT=,30 +ENUM_PREFIX_FOR_DE=+49 + +; this this the head number, you need to change it to teh value provided by your providers, in consist of 10 digit, this is important as we will cut the number and normalize it before it enters the IMS Core, there is various names for Head number like : Direct dial in .. prefix numbers..etc so its basiclly the number from your SIPTrunk Provider that can be extended and add digits to it + +PHONE_NR_HEAD=1234567890 + +; Dont change +ICP_OUT=ICP_LINK_out +ICP_IN=ims_core +; change to your provider's provided domain +SIPTRUNK_DOMAIN=PROVIDER_DOMAIN +; Dont change +IMS_CN_DOMAIN=IMS_DOMAIN +PAI_HEADER=P-Asserted-Identity +PPI_HEADER=P-Preferred-Identity +NO_FORK=Request-Disposition +P_HEADER=P-Early-Media +X_HEADER=P-MeinSipTrunk + +; now the dial plan, here is an explnination so you can adjust what you need to make it able to proccess calls and send it to and from teh IMS Core +; in "incoming" in my case i used an internal MSISDN for my open5GS Netwrok 0912584710 as you see this is a private self generated number. +; in normal world there is a shared Database for all operator so they know that a numer belong to a specific operator, in our case the netwrok is private and our +; numbers are unknown to teh wolrd, so I had to do a trick, this trick consist of the head numer provided from my SIPTrunk provider adding the UE MSISDN to it liek that: +; CC+HEADER_NUMER+MSSIDN = +49 228 1234567 0912584710 and then cut or add the CC+HEADER_NUMER depanding on the direction : +; to IMS Core cute CC+HEADER_NUMER, if to outside world then add CC+HEADER_NUMER +; this is using the ${EXTEN:n} "n" is where the digit that need to stay along with the digits the come after it. in my case its the 0, so the results will be 0912584710 that will +; be recognized insdie my private network, this need to be adjusted depand on the your needs like the lenth of your Head number and your MSISDN. +; after doing that we need to send the call to the ICSCF as we dont know where the user is registred, the rest will be done insdie the IMS Core+Open5GS +; +; its preconfigured here on digit 13 ( UK users please change it! not to trigger any bad luck!) + + +[incoming] + +; +49 228 1234567 + any +exten => _${ENUM_PREFIX_FOR_DE}${PHONE_NR_HEAD}X.,1,Verbose(incoming call from ICP from ${CALLERID(num)} calling to ${EXTEN:13}) +same => n,Verbose(check for exten ${EXTEN} 8 ${EXTEN:8} 9 ${EXTEN:9} 10 ${EXTEN:10} 11 ${EXTEN:11} 13 ${EXTEN:13} ) +; cutting until digi 13 CUT0912584710 set some headers and send to icscf to reach the users +same => n,Dial(PJSIP/${ICP_IN}/sip:${EXTEN:13}@${IMS_CN_DOMAIN},120,b(outgoing^ims_inc^1)) +same => n,Hangup() + +[outgoing] + +; Due to diffrent way that the devices do calls there is two way defined here eather the call will start with 0 ( in teh IMS is not possbile) or with + + +; here is with 0, its not applicale, our IMS is 3gpp compitable so it has always E164 +exten => _0X.,1,Verbose(outgoing conext leading null ${EXTEN} calling from IMS User ${CALLERID(num)} ) +same => n,Dial(PJSIP/${ICP_OUT}/sip:${ENUM_PREFIX_FOR_DE}${EXTEN:1}@${SIPTRUNK_DOMAIN},120,b(outgoing^headers^1)) +same => n,Hangup() + + +; here is the used one as we use E164 in IMS +exten => _${ENUM_PREFIX_FOR_DE}X.,1,Verbose(outgoing Call leading +49 calling from IMS User ${CALLERID(num)} to ${EXTEN} ) +same => n,Verbose(Sending INVITE to ICP) +; we set the head number and add the MSISDN to it then set it in the "From" header +same => n,Set(CALLERID(num)=${ENUM_PREFIX_FOR_DE}${PHONE_NR_HEAD}${CALLERID(num)}) +; setting some headers and sends the INVITE to the Provdier/ICP +same => n,Dial(PJSIP/${ICP_OUT}/sip:${EXTEN}@${SIPTRUNK_DOMAIN},120,b(outgoing^ims_out^1)) +same => n,Hangup() + +; this headers used in outgoing +exten => ims_out,1,Verbose(Setting required headers in outgoing INVITE) +; setting the P-Preferred-Identity and optionally P-Preferred-Identity ( PAI is only a Networ thing) here we do the the as we done with From: +; adding the MSISDN ot the head number before sending it out. +same => n,Set(PJSIP_HEADER(add,${PPI_HEADER})=) +same => n,Set(PJSIP_HEADER(add,${PAI_HEADER})=) +; Setting P-Early-Media to Supported, Asterisk know nothing about RFC5009, but its required by 3GPP, so we can only cheat here sorry! +same => n,Set(PJSIP_HEADER(add,${P_HEADER})=Supported) +same => n,Set(PJSIP_HEADER(add,Supported)=199) +same => n,Return() + +; for incoming we need to set the PAI, some devices need this header +exten => ims_inc,1,Verbose(Setting required headers in incoming INVITE) +same => n,Set(PJSIP_HEADER(add,${PAI_HEADER})=) +same => n,Set(PJSIP_HEADER(add,${PAI_HEADER})=) +same => n,Set(PJSIP_HEADER(add,${P_HEADER})=Supported) +same => n,Set(PJSIP_HEADER(add,Supported)=199) +same => n,Return() + +[IMS_INC] + +include => outgoing + +;;;;;;; Voicemail IMS, this is a WIP, need to add appreciate IFC for it, dont forget to confgure your MSISDN in the voicemail.conf!! + +; configure teh start of your number instaed of "09125" eg. if your MSISDN start with 09125123456 then exten => _09125X. +exten => _09125X.,1,Verbose(1, Caller ${CALLERID(all)} has entered Voicemail for ${EXTEN} from IMS ) +same => n,VoiceMail(${EXTEN}) + +exten => 500,1,Ringing() +exten => 500,n,Wait(2) +exten => 500,n,Answer +exten => 500,n,Wait(2) +exten => 500,n,VoiceMailMain(${CALLERID(num)}) +exten => 500,n,HangUp() +exten => 500,n,PlayBack(vm-goodbye) +exten => 500,n,HangUp() + diff --git a/ibcf/config/indications.conf b/ibcf/config/indications.conf new file mode 100644 index 0000000..ccf249d --- /dev/null +++ b/ibcf/config/indications.conf @@ -0,0 +1,18 @@ +[general] +country = us ; We are in Waldo, Al, USA so the US is our default. + +[us] +description = United States / North America +ringcadence = 2000,4000 +dial = 350+440 +busy = 480+620/500,0/500 +ring = 440+480/2000,0/4000 +congestion = 480+620/250,0/250 +callwaiting = 440/300,0/10000 +dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440 +record = 1400/500,0/15000 +info = !950/330,!1400/330,!1800/330,0 +stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440 + +; Additional country configurations can be found in the Asterisk source +; at /configs/samples/indications.conf.sample diff --git a/ibcf/config/logger.conf b/ibcf/config/logger.conf new file mode 100644 index 0000000..8b0a1c1 --- /dev/null +++ b/ibcf/config/logger.conf @@ -0,0 +1,9 @@ +[general] + +[logfiles] + +console = verbose,notice,warning,error + +;messages = notice,warning,error +;full = verbose,notice,warning,error,debug +;security = security diff --git a/ibcf/config/modules.conf b/ibcf/config/modules.conf new file mode 100644 index 0000000..b2277e2 --- /dev/null +++ b/ibcf/config/modules.conf @@ -0,0 +1,130 @@ +[modules] +autoload = no + +; This is a minimal module load. We are loading only the modules +; required for the Asterisk features used in the "Super Awesome +; Company" configuration. + +; Applications + +load = app_bridgewait.so +load = app_dial.so +load = app_playback.so +load = app_stack.so +load = app_verbose.so +load = app_voicemail.so +load = app_directory.so +load = app_confbridge.so +load = app_queue.so +load = app_echo.so +load = app_mp3.so +load = app_transfer.so + + +; Bridging + +load = bridge_builtin_features.so +load = bridge_builtin_interval_features.so +load = bridge_holding.so +load = bridge_native_rtp.so +load = bridge_simple.so +load = bridge_softmix.so + +; Call Detail Records + +load = cdr_custom.so + +; Channel Drivers + +load = chan_bridge_media.so +load = chan_pjsip.so + +; Codecs + +load = codec_gsm.so +load = codec_resample.so +load = codec_ulaw.so +load = codec_g722.so +load = codec_evs.so +load = codec_alaw.so +load = codec_amr.so + +; Formats + +load = format_gsm.so +load = format_pcm.so +load = format_wav_gsm.so +load = format_wav.so +load = format_mp3.so + +; Functions + +load = func_callerid.so +load = func_cdr.so +load = func_pjsip_endpoint.so +load = func_sorcery.so +load = func_devstate.so +load = func_strings.so +load = func_srv.so + +; Core/PBX + +load = pbx_config.so + +; Resources + +load = res_http_websocket.so +load = res_musiconhold.so +load = res_pjproject.so +load = res_pjsip_acl.so +load = res_pjsip_authenticator_digest.so +load = res_pjsip_caller_id.so +load = res_pjsip_dialog_info_body_generator.so +load = res_pjsip_diversion.so +load = res_pjsip_dtmf_info.so +load = res_pjsip_endpoint_identifier_anonymous.so +load = res_pjsip_endpoint_identifier_ip.so +load = res_pjsip_endpoint_identifier_user.so +load = res_pjsip_exten_state.so +load = res_pjsip_header_funcs.so +load = res_pjsip_logger.so +load = res_pjsip_messaging.so +load = res_pjsip_mwi_body_generator.so +load = res_pjsip_mwi.so +load = res_pjsip_nat.so +load = res_pjsip_notify.so +load = res_pjsip_one_touch_record_info.so +load = res_pjsip_outbound_authenticator_digest.so +load = res_pjsip_outbound_publish.so +load = res_pjsip_outbound_registration.so +load = res_pjsip_path.so +load = res_pjsip_pidf_body_generator.so +load = res_pjsip_pidf_digium_body_supplement.so +load = res_pjsip_pidf_eyebeam_body_supplement.so +load = res_pjsip_publish_asterisk.so +load = res_pjsip_pubsub.so +load = res_pjsip_refer.so +load = res_pjsip_registrar.so +load = res_pjsip_rfc3326.so +load = res_pjsip_sdp_rtp.so +load = res_pjsip_send_to_voicemail.so +load = res_pjsip_session.so +load = res_pjsip.so +load = res_pjsip_t38.so +load = res_pjsip_transport_websocket.so +load = res_pjsip_xpidf_body_generator.so +load = res_rtp_asterisk.so +load = res_sorcery_astdb.so +load = res_sorcery_config.so +load = res_sorcery_memory.so +load = res_sorcery_realtime.so +load = res_timing_timerfd.so +load = res_format_attr_amr.so +load = res_format_attr_evs.so + +; Do not load res_hep and kin unless you are using HEP monitoring +; in your network. + +noload = res_hep.so +noload = res_hep_pjsip.so +noload = res_hep_rtcp.so diff --git a/ibcf/config/musiconhold.conf b/ibcf/config/musiconhold.conf new file mode 100644 index 0000000..bc3ba21 --- /dev/null +++ b/ibcf/config/musiconhold.conf @@ -0,0 +1,5 @@ +[general] + +[default] +mode = files +directory = moh diff --git a/ibcf/config/pjsip.conf b/ibcf/config/pjsip.conf new file mode 100644 index 0000000..2489407 --- /dev/null +++ b/ibcf/config/pjsip.conf @@ -0,0 +1,148 @@ +; configure here your ICP Link towards outsdie ( SIPTRunk account ...etc) + +[global] +type=global +user_agent=IBCF VoLTE +keep_alive_interval=20 +; Add some default Number to be use in case From not specficed otherwise you can coment it out +default_from_user=_DEFAULT_NUMBER +;endpoint_identifier_order=ip +ignore_uri_user_options=yes +max_forwards=70 +allow_sending_180_after_183=yes + +; Protect your IBCF with ACL! write permit/deny IPs in acl.conf, this is important to prevent untrusted IP from trying to reach this PBX +[ibcf_acl] +type=acl +acl=ibcf_acl + +; Transport definations, nothing important here, unless you want to change something +[transport-tcp-nat] +type=transport +protocol=tcp +bind=0.0.0.0:5090 +tos=192 +local_net=172.22.0.0/24 + +[transport-udp] +type=transport +protocol=udp +bind=0.0.0.0:5090 +local_net=172.22.0.0/24 +;tos=192 + +; here is the registration info for your Trunking Account, if you use a real ICP over the "Ic" Reference Point the configuration is diffrent, it will be more like Static Registration +; IMPORTANT!!! change the vaulues : PROVIDER_PCSCF, PROVIDER_SIP_DOMIAN with your provider's provided info!, dont change other values! + +[defaults_registration](!) +type=registration +transport=transport-tcp-nat +outbound_proxy=sip:PROVIDER_PCSCF\;transport=tcp\;lr +server_uri=sip:PROVIDER_SIP_DOMIAN\;transport=tcp\;lr +retry_interval=900 +forbidden_retry_interval=1800 +fatal_retry_interval=1800 +expiration=480 +auth_rejection_permanent=no +line=yes +max_retries=99 + +; Replace with your account data!! +; Replace the values : AUTH_USERNAME@PROVIDER_DOMIAN and CONTACT_USER with your provider's provided info!, dont change other values! +[ICP_LINK](defaults_registration) +outbound_auth=ICP_LINK +client_uri=sip:AUTH_USERNAME@PROVIDER_DOMIAN +contact_user=CONTACT_USER +endpoint=ICP_LINK_in + +; here is the type of authentication, in Register Mode you need to provide a user name and password +; replace only : PROVIDER_USERNAME, PROVIDER_PASSWD and PROVIDER_DOMIAN with your provider's provided info!, dont change other values! +[ICP_LINK] +type=auth +auth_type=userpass +username=PROVIDER_USERNAME +password=PROVIDER_PASSWD +realm=PROVIDER_DOMIAN + +; Trunk Setting optimize what you like here, read Docs from Asterisk for more info. +; Replace PROVIDER_PCSCF with your provider's provided info. +[defaults_endpoint](!) +type=endpoint +transport=transport-tcp-nat +;removed for double contacts +outbound_proxy=sip:PROVIDER_PCSCF\;transport=tcp\;lr +allow=!all,amrwb,amr,g722,alaw,h264 +inband_progress=yes +direct_media=no +dtmf_mode=auto +;send_pai=yes +;send_rpid=yes +;100rel=required +100rel=yes +tos_audio=184 +rtp_symmetric=yes +rtp_keepalive=1 +moh_suggest=default +moh_passthrough=yes +send_diversion=yes +suppress_q850_reason_headers=yes +user_eq_phone=yes +preferred_codec_only=yes +;tos_video=af41 +;cos_video=4 +direct_media_glare_mitigation=outgoing +suppress_moh_on_sendonly=yes +use_ptime=yes + +; Outgoing Leg +; Replace PROVIDER_DOMIAN and CONTACT_USER with your provider's provided info. +[ICP_LINK_out](defaults_endpoint) +context=outgoing +outbound_auth=ICP_LINK +aors=ICP_LINK +;media_encryption=no +from_domain=PROVIDER_DOMIAN +contact_user=CONTACT_USER + +[ICP_LINK_in](defaults_endpoint) +outbound_auth=ICP_LINK +context=incoming + +; Replace CONTACT_USER with your provider's provided info. +[ICP_LINK] +type=aor +contact=sip:CONTACT_USER + +; here match the incoming request to only a specific IPs like your provider's Subnet and your IMS Core/Internal Subnet +[ICP_LINK_in] +type=identify +endpoint=ICP_LINK_in +match=PROVIDER_SUBNET/24 +match=DOCKER_HOST_SUBNET/24 + + +;;; here is the IMS Core IF, no need to change things here unless you have to. + +[ims_core] +type=endpoint +aors=ims_core +allow_unauthenticated_options=yes +transport=transport-udp +context=IMS_INC +allow=!all,evs,amrwb,amr,g722,alaw,h264 +dtmf_mode=auto +tos_audio=184 +send_diversion=yes +preferred_codec_only=yes + + +[ims_core] +type=identify +endpoint=ims_core +match=172.22.0.0/24 + +[ims_core] +type=aor +;contact=sip:172.22.0.20 +max_contacts=3 +;qualify_frequency=60 diff --git a/ibcf/config/pjsip_notify.conf b/ibcf/config/pjsip_notify.conf new file mode 100644 index 0000000..8224ee1 --- /dev/null +++ b/ibcf/config/pjsip_notify.conf @@ -0,0 +1,57 @@ +; rfc3842 +; put empty "Content=>" at the end to have CRLF after last body line + +[clear-mwi] +Event=>message-summary +Content-type=>application/simple-message-summary +Content=>Messages-Waiting: no +Content=>Message-Account: sip:asterisk@127.0.0.1 +Content=>Voice-Message: 0/0 (0/0) +Content=> + +; Aastra + +[aastra-check-cfg] +Event=>check-sync + +[aastra-xml] +Event=>aastra-xml + +; Digium + +[digium-check-cfg] +Event=>check-sync + +; Linksys + +[linksys-cold-restart] +Event=>reboot_now + +[linksys-warm-restart] +Event=>restart_now + +; Polycom + +[polycom-check-cfg] +Event=>check-sync + +; Sipura + +[sipura-check-cfg] +Event=>resync + +[sipura-get-report] +Event=>report + +; snom + +[snom-check-cfg] +Event=>check-sync\;reboot=false + +[snom-reboot] +Event=>check-sync\;reboot=true + +; Cisco + +[cisco-check-cfg] +Event=>check-sync diff --git a/ibcf/config/queues.conf b/ibcf/config/queues.conf new file mode 100644 index 0000000..8aaa0b4 --- /dev/null +++ b/ibcf/config/queues.conf @@ -0,0 +1,19 @@ +[general] +monitor-type = MixMonitor + +;========================Sales Queue == +; Calls all sales persons in a ring-all fashion +[sales] +strategy=ringall +member => PJSIP/1109 ; Terry Jules - Director of Sales +member => PJSIP/1105 ; Garnet Claude - Sales Associate +member => PJSIP/1112 ; Franny Ocean - Sales Associate + +;===================== Customer Advocate Queue == +; Calls all customer advocates in a ring-all fashion +[customer_advocate] +strategy=ringall +member => PJSIP/1101 ; Maria Berny - Director of Customer Experience +member => PJSIP/1115 ; Dusty Williams - Customer Advocate +member => PJSIP/1102 ; Tommy Briar - Customer Advocate + diff --git a/ibcf/config/rtp.conf b/ibcf/config/rtp.conf new file mode 100644 index 0000000..37283df --- /dev/null +++ b/ibcf/config/rtp.conf @@ -0,0 +1,3 @@ +[general] +rtpstart=10000 +rtpend=10100 \ No newline at end of file diff --git a/ibcf/config/voicemail.conf b/ibcf/config/voicemail.conf new file mode 100644 index 0000000..75bb8a7 --- /dev/null +++ b/ibcf/config/voicemail.conf @@ -0,0 +1,17 @@ +[general] +format=wav49 ; Voicemail file format +maxmsg=100 ; Maximum number of messages per mailbox +minsecs=3 ; Minimum length of a message in seconds +maxsecs=300 ; Maximum length of a message in seconds +maxlogins=3 ; Maximum number of incorrect password attempts before hanging up +sendvoicemail=yes ; Allow sending voicemail (yes/no) +emailsubject=New Voicemail Message ${VM_MSGNUM} in Mailbox ${VM_MAILBOX} +fromstring=Voicemail +serveremail=my_vonr-vm@voicemail.IMS_DOMAIN ; Default sender email address + + +[IMS_Users] +; Voicemail context for all internal users in the example.com domain. +; Format is : MSISDN => VM_PIN,Name,Email +MSISDN => 1234,VoNR_One,MSISDN@voicemail.IMS_DOMAIN +MSISDN => 4567,VoNR_Two,MSISDN@voicemail.IMS_DOMAIN diff --git a/ibcf/menuselect.makedeps b/ibcf/menuselect.makedeps new file mode 100644 index 0000000..89d2c79 --- /dev/null +++ b/ibcf/menuselect.makedeps @@ -0,0 +1,234 @@ +MENUSELECT_DEPENDS_chan_mobile=BLUETOOTH +MENUSELECT_DEPENDS_res_config_mysql=MYSQLCLIENT +MENUSELECT_DEPENDS_app_flash=DAHDI +MENUSELECT_DEPENDS_app_voicemail_imap=IMAP_TK +MENUSELECT_DEPENDS_app_voicemail_odbc=GENERIC_ODBC +MENUSELECT_DEPENDS_app_jack=JACK RESAMPLE +MENUSELECT_DEPENDS_app_meetme=DAHDI +MENUSELECT_DEPENDS_binaural_rendering_in_bridge_softmix=FFTW3 +MENUSELECT_DEPENDS_cdr_adaptive_odbc=GENERIC_ODBC +MENUSELECT_DEPENDS_cdr_beanstalkd=BEANSTALK +MENUSELECT_DEPENDS_cdr_odbc=GENERIC_ODBC +MENUSELECT_DEPENDS_cdr_pgsql=PGSQL +MENUSELECT_DEPENDS_cdr_radius=RADIUS +MENUSELECT_DEPENDS_cdr_sqlite3_custom=SQLITE3 +MENUSELECT_DEPENDS_cdr_tds=FREETDS +MENUSELECT_DEPENDS_cel_odbc=GENERIC_ODBC +MENUSELECT_DEPENDS_cel_beanstalkd=BEANSTALK +MENUSELECT_DEPENDS_cel_pgsql=PGSQL +MENUSELECT_DEPENDS_cel_radius=RADIUS +MENUSELECT_DEPENDS_cel_sqlite3_custom=SQLITE3 +MENUSELECT_DEPENDS_cel_tds=FREETDS +MENUSELECT_DEPENDS_chan_dahdi=DAHDI TONEZONE PRI SS7 OPENR2 +MENUSELECT_DEPENDS_chan_iax2=CRYPTO +MENUSELECT_DEPENDS_chan_motif=IKSEMEL OPENSSL +MENUSELECT_DEPENDS_chan_pjsip=PJPROJECT +MENUSELECT_DEPENDS_chan_console=PORTAUDIO +MENUSELECT_DEPENDS_codec_codec2=CODEC2 +MENUSELECT_DEPENDS_codec_dahdi=DAHDI +MENUSELECT_DEPENDS_codec_gsm=GSM +MENUSELECT_DEPENDS_codec_ilbc=ILBC +MENUSELECT_DEPENDS_codec_speex=SPEEX SPEEX_PREPROCESS SPEEXDSP +MENUSELECT_DEPENDS_codec_amr=AMR_NB AMR_WB_DECODER AMR_WB_ENCODER +MENUSELECT_DEPENDS_codec_evs=EVS +MENUSELECT_DEPENDS_codec_opus=XMLSTARLET BASH +MENUSELECT_DEPENDS_codec_silk=XMLSTARLET BASH +MENUSELECT_DEPENDS_codec_siren7=XMLSTARLET BASH +MENUSELECT_DEPENDS_codec_siren14=XMLSTARLET BASH +MENUSELECT_DEPENDS_codec_g729a=XMLSTARLET BASH +MENUSELECT_DEPENDS_format_ogg_vorbis=VORBIS OGG +MENUSELECT_DEPENDS_format_ogg_speex=SPEEX OGG +MENUSELECT_DEPENDS_func_aes=CRYPTO +MENUSELECT_DEPENDS_func_curl=CURL +MENUSELECT_DEPENDS_func_iconv=ICONV +MENUSELECT_DEPENDS_func_odbc=GENERIC_ODBC +MENUSELECT_DEPENDS_func_pjsip_aor=PJPROJECT +MENUSELECT_DEPENDS_func_pjsip_contact=PJPROJECT +MENUSELECT_DEPENDS_func_pjsip_endpoint=PJPROJECT +MENUSELECT_DEPENDS_func_speex=SPEEX SPEEX_PREPROCESS SPEEXDSP +MENUSELECT_DEPENDS_pbx_dundi=ZLIB CRYPTO +MENUSELECT_DEPENDS_pbx_lua=LUA +MENUSELECT_DEPENDS_res_config_curl=CURL +MENUSELECT_DEPENDS_res_config_odbc=GENERIC_ODBC +MENUSELECT_DEPENDS_res_config_sqlite3=SQLITE3 +MENUSELECT_DEPENDS_res_crypto=OPENSSL +MENUSELECT_DEPENDS_res_curl=CURL +MENUSELECT_DEPENDS_res_geolocation=LIBXML2 LIBXSLT +MENUSELECT_DEPENDS_res_http_media_cache=CURL +MENUSELECT_DEPENDS_res_http_post=GMIME +MENUSELECT_DEPENDS_res_odbc=GENERIC_ODBC +MENUSELECT_DEPENDS_res_odbc_transaction=GENERIC_ODBC +MENUSELECT_DEPENDS_res_pjproject=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_acl=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_authenticator_digest=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_caller_id=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_config_wizard=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_dialog_info_body_generator=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_diversion=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_dlg_options=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_dtmf_info=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_empty_info=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_endpoint_identifier_anonymous=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_endpoint_identifier_ip=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_endpoint_identifier_user=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_exten_state=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_geolocation=PJPROJECT LIBXML2 +MENUSELECT_DEPENDS_res_pjsip_header_funcs=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_logger=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_messaging=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_mwi=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_mwi_body_generator=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_nat=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_notify=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_one_touch_record_info=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_outbound_authenticator_digest=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_outbound_publish=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_outbound_registration=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_path=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_pidf_body_generator=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_pidf_digium_body_supplement=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_pidf_eyebeam_body_supplement=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_publish_asterisk=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_pubsub=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_refer=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_registrar=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_rfc3326=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_rfc3329=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_sdp_rtp=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_send_to_voicemail=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_session=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_sips_contact=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_stir_shaken=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_t38=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_transport_websocket=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_xpidf_body_generator=PJPROJECT +MENUSELECT_DEPENDS_res_resolver_unbound=UNBOUND +MENUSELECT_DEPENDS_res_rtp_asterisk=OPENSSL PJPROJECT +MENUSELECT_DEPENDS_res_srtp=SRTP OPENSSL +MENUSELECT_DEPENDS_res_stasis_test=TEST_FRAMEWORK +MENUSELECT_DEPENDS_res_stir_shaken=CURL LIBJWT +MENUSELECT_DEPENDS_res_timing_dahdi=DAHDI +MENUSELECT_DEPENDS_res_timing_timerfd=TIMERFD +MENUSELECT_DEPENDS_res_xmpp=IKSEMEL OPENSSL +MENUSELECT_DEPENDS_res_calendar_caldav=NEON ICAL LIBXML2 +MENUSELECT_DEPENDS_res_calendar_ews=NEON29 +MENUSELECT_DEPENDS_res_calendar_exchange=NEON ICAL IKSEMEL +MENUSELECT_DEPENDS_res_calendar_icalendar=NEON ICAL +MENUSELECT_DEPENDS_res_config_ldap=LDAP +MENUSELECT_DEPENDS_res_config_pgsql=PGSQL +MENUSELECT_DEPENDS_res_corosync=COROSYNC +MENUSELECT_DEPENDS_res_fax_spandsp=SPANDSP +MENUSELECT_DEPENDS_res_hep_pjsip=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_aoc=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_history=PJPROJECT +MENUSELECT_DEPENDS_res_pjsip_phoneprov_provider=PJPROJECT +MENUSELECT_DEPENDS_res_prometheus=PJPROJECT +MENUSELECT_DEPENDS_res_snmp=NETSNMP +MENUSELECT_DEPENDS_res_timing_kqueue=KQUEUE +MENUSELECT_DEPENDS_res_digium_phone=XMLSTARLET BASH +MENUSELECT_DEPENDS_res_pjsip_config_sangoma=XMLSTARLET BASH +MENUSELECT_DEPENDS_test_abstract_jb=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_acl=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_aeap=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_aeap_speech=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_aeap_transaction=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_aeap_transport=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_amihooks=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_aoc=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_app=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_ari=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_ari_model=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_ast_format_str_reduce=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_astobj2=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_astobj2_thrash=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_astobj2_weaken=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_bridging=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_bucket=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_callerid=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_capture=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_cdr=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_cel=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_channel=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_channel_feature_hooks=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_config=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_conversions=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_core_codec=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_core_format=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_crypto=TEST_FRAMEWORK CRYPTO +MENUSELECT_DEPENDS_test_data_buffer=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_db=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_devicestate=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_dlinklists=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_dns=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_dns_naptr=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_dns_query_set=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_dns_recurring=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_dns_srv=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_endpoints=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_event=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_expr=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_file=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_format_cache=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_format_cap=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_func_file=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_gosub=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_hashtab_thrash=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_heap=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_http_media_cache=TEST_FRAMEWORK CURL +MENUSELECT_DEPENDS_test_jitterbuf=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_json=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_linkedlists=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_locale=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_logger=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_media_cache=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_message=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_mwi=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_named_lock=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_netsock2=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_optional_api=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_pbx=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_poll=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_res_pjsip_scheduler=TEST_FRAMEWORK PJPROJECT +MENUSELECT_DEPENDS_test_res_pjsip_session_caps=TEST_FRAMEWORK PJPROJECT +MENUSELECT_DEPENDS_test_res_rtp=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_res_stasis=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_sched=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_scope_trace=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_scoped_lock=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_security_events=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_skel=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_sorcery=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_sorcery_astdb=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_sorcery_memory_cache_thrash=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_sorcery_realtime=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_stasis=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_stasis_channels=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_stasis_endpoints=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_stasis_state=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_stream=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_stringfields=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_strings=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_substitution=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_taskprocessor=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_threadpool=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_time=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_uri=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_utils=TEST_FRAMEWORK CRYPTO +MENUSELECT_DEPENDS_test_uuid=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_vector=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_voicemail_api=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_websocket_client=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_xml_escape=TEST_FRAMEWORK +MENUSELECT_DEPENDS_test_res_prometheus=TEST_FRAMEWORK CURL +MENUSELECT_DEPENDS_BETTER_BACKTRACES=BFD DLADDR +MENUSELECT_DEPENDS_BUILD_NATIVE=NATIVE_ARCH +MENUSELECT_DEPENDS_REBUILD_PARSERS=BISON FLEX +MENUSELECT_DEPENDS_USE_HOARD_ALLOCATOR=HOARD +MENUSELECT_DEPENDS_ADDRESS_SANITIZER=HAVE_ADDRESS_SANITIZER +MENUSELECT_DEPENDS_THREAD_SANITIZER=HAVE_THREAD_SANITIZER +MENUSELECT_DEPENDS_LEAK_SANITIZER=HAVE_LEAK_SANITIZER +MENUSELECT_DEPENDS_UNDEFINED_SANITIZER=HAVE_UNDEFINED_SANITIZER +MENUSELECT_DEPENDS_smsq=POPT +MENUSELECT_DEPENDS_conf_bridge_binaural_hrir_importer=SNDFILE +MENUSELECT_DEPENDS_astman=NEWT diff --git a/ibcf/menuselect.makeopts b/ibcf/menuselect.makeopts new file mode 100644 index 0000000..c777e1e --- /dev/null +++ b/ibcf/menuselect.makeopts @@ -0,0 +1,122 @@ +MENUSELECT_ADDONS=chan_mobile chan_ooh323 res_config_mysql +MENUSELECT_APPS=app_flash app_skel app_voicemail_imap app_voicemail_odbc app_statsd app_meetme +MENUSELECT_BRIDGES=binaural_rendering_in_bridge_softmix +MENUSELECT_CDR=cdr_beanstalkd +MENUSELECT_CEL=cel_beanstalkd +MENUSELECT_CHANNELS=chan_dahdi +MENUSELECT_CODECS=codec_dahdi codec_opus codec_silk codec_siren7 codec_siren14 codec_g729a +MENUSELECT_FORMATS= +MENUSELECT_FUNCS= +MENUSELECT_PBX= +MENUSELECT_RES=res_ari_mailboxes res_mwi_external res_mwi_external_ami res_pjsip_stir_shaken res_stasis_mailbox res_stasis_test res_stir_shaken res_timing_dahdi res_chan_stats res_cliexec res_corosync res_endpoint_stats res_remb_modifier res_timing_kqueue res_digium_phone res_pjsip_config_sangoma +MENUSELECT_TESTS=test_abstract_jb test_acl test_aeap test_aeap_speech test_aeap_transaction test_aeap_transport test_amihooks test_aoc test_app test_ari test_ari_model test_ast_format_str_reduce test_astobj2 test_astobj2_thrash test_astobj2_weaken test_bridging test_bucket test_callerid test_capture test_cdr test_cel test_channel test_channel_feature_hooks test_config test_conversions test_core_codec test_core_format test_crypto test_data_buffer test_db test_devicestate test_dlinklists test_dns test_dns_naptr test_dns_query_set test_dns_recurring test_dns_srv test_endpoints test_event test_expr test_file test_format_cache test_format_cap test_func_file test_gosub test_hashtab_thrash test_heap test_http_media_cache test_jitterbuf test_json test_linkedlists test_locale test_logger test_media_cache test_message test_mwi test_named_lock test_netsock2 test_optional_api test_pbx test_poll test_res_pjsip_scheduler test_res_pjsip_session_caps test_res_rtp test_res_stasis test_sched test_scope_trace test_scoped_lock test_security_events test_skel test_sorcery test_sorcery_astdb test_sorcery_memory_cache_thrash test_sorcery_realtime test_stasis test_stasis_channels test_stasis_endpoints test_stasis_state test_stream test_stringfields test_strings test_substitution test_taskprocessor test_threadpool test_time test_uri test_utils test_uuid test_vector test_voicemail_api test_websocket_client test_xml_escape test_res_prometheus +MENUSELECT_CFLAGS=BUILD_NATIVE OPTIONAL_API +MENUSELECT_UTILS=astcanary astdb2sqlite3 astdb2bdb +MENUSELECT_AGIS= +MENUSELECT_CORE_SOUNDS=CORE-SOUNDS-EN-WAV CORE-SOUNDS-EN-ALAW CORE-SOUNDS-EN-GSM CORE-SOUNDS-EN-G722 +MENUSELECT_MOH=MOH-OPSOUND-WAV MOH-OPSOUND-ALAW MOH-OPSOUND-GSM MOH-OPSOUND-G722 +MENUSELECT_EXTRA_SOUNDS=EXTRA-SOUNDS-EN-WAV EXTRA-SOUNDS-EN-ALAW EXTRA-SOUNDS-EN-GSM EXTRA-SOUNDS-EN-G722 +MENUSELECT_BUILD_DEPS=bridge_holding app_cdr func_periodic_hook app_confbridge res_speech res_agi res_stasis res_adsi res_smdi res_audiosocket res_odbc res_crypto res_xmpp res_pjsip res_pjsip_pubsub res_pjsip_session res_rtp_multicast res_curl app_chanspy func_cut func_groupcount func_uri res_ael_share res_http_websocket res_ari res_ari_model res_stasis_recording res_stasis_playback res_stasis_answer res_stasis_snoop res_stasis_device_state func_curl res_odbc_transaction res_sorcery_config res_pjproject res_sorcery_memory res_sorcery_astdb res_statsd res_geolocation res_pjsip_outbound_publish chan_pjsip res_calendar res_fax res_hep res_phoneprov res_pjsip_outbound_registration DONT_OPTIMIZE G711_NEW_ALGORITHM +MENUSELECT_DEPSFAILED=MENUSELECT_APPS=app_flash +MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_beanstalkd +MENUSELECT_DEPSFAILED=MENUSELECT_CEL=cel_beanstalkd +MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_dahdi +MENUSELECT_DEPSFAILED=MENUSELECT_CODECS=codec_dahdi +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_pjsip_stir_shaken +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_stasis_test +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_stir_shaken +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_timing_dahdi +MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_timing_kqueue +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_abstract_jb +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_acl +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_aeap +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_aeap_speech +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_aeap_transaction +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_aeap_transport +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_amihooks +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_aoc +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_app +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_ari +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_ari_model +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_ast_format_str_reduce +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_astobj2 +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_astobj2_thrash +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_astobj2_weaken +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_bridging +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_bucket +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_callerid +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_capture +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_cdr +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_cel +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_channel +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_channel_feature_hooks +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_config +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_conversions +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_core_codec +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_core_format +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_crypto +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_data_buffer +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_db +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_devicestate +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dlinklists +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dns +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dns_naptr +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dns_query_set +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dns_recurring +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dns_srv +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_endpoints +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_event +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_expr +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_file +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_format_cache +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_format_cap +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_func_file +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_gosub +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_hashtab_thrash +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_heap +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_http_media_cache +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_jitterbuf +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_json +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_linkedlists +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_locale +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_logger +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_media_cache +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_message +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_mwi +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_named_lock +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_netsock2 +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_optional_api +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_pbx +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_poll +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_res_pjsip_scheduler +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_res_pjsip_session_caps +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_res_rtp +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_res_stasis +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_sched +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_scope_trace +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_scoped_lock +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_security_events +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_skel +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_sorcery +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_sorcery_astdb +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_sorcery_memory_cache_thrash +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_sorcery_realtime +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stasis +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stasis_channels +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stasis_endpoints +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stasis_state +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stream +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stringfields +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_strings +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_substitution +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_taskprocessor +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_threadpool +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_time +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_uri +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_utils +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_uuid +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_vector +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_voicemail_api +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_websocket_client +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_xml_escape +MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_res_prometheus diff --git a/ibcf/start-asterisk.sh b/ibcf/start-asterisk.sh new file mode 100755 index 0000000..6dbeaba --- /dev/null +++ b/ibcf/start-asterisk.sh @@ -0,0 +1,16 @@ +#!/bin/bash + + +[ ${#MNC} == 3 ] && IMS_DOMAIN="ims.mnc${MNC}.mcc${MCC}.3gppnetwork.org" || IMS_DOMAIN="ims.mnc0${MNC}.mcc${MCC}.3gppnetwork.org" + +cp /mnt/ibcf/config/* /etc/asterisk/ + +sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/asterisk/pjsip.conf +sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/asterisk/extensions.conf +sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/asterisk/voicemail.conf +sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/asterisk/extensions.conf + +# Start server. +echo 'Starting Asterisk' + +asterisk -f \ No newline at end of file diff --git a/sa-vonr-deploy.yaml b/sa-vonr-deploy.yaml index 814880b..2ad7cef 100644 --- a/sa-vonr-deploy.yaml +++ b/sa-vonr-deploy.yaml @@ -506,6 +506,29 @@ services: networks: default: ipv4_address: ${GRAFANA_IP} + ibcf: + build: ./ibcf + image: ibcf_cloud + container_name: ibcf_voicemail + dns: ${DNS_IP} + privileged: true + env_file: + - .env + volumes: + - ./ibcf:/mnt/ibcf + environment: + - COMPONENT_NAME=ibcf_voicemail + expose: + - "5090/tcp" + - "5090/udp" + - "10000-10100/udp" + ports: + - "5090:5090/tcp" + - "10000-10100:10000-10100/udp" + networks: + default: + ipv4_address: ${IBCF_IP} + networks: default: ipam: diff --git a/scscf/scscf/CxDataType_Rel6.xsd b/scscf/scscf/CxDataType_Rel6.xsd new file mode 100644 index 0000000..3eb21b7 --- /dev/null +++ b/scscf/scscf/CxDataType_Rel6.xsd @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + iFC is part of the registered profile + + + + + + + + iFC is part of the unregistered profile + + + + + + + + + + + + + + + + + + + + + + + Matches to REGISTER messages that are related to initial registration + + + + + + + + Matches to REGISTER messages that are related to re-registration + + + + + + + + Matches to REGISTER messages that are related to de-registration + + + + + + + + + + + + + Session Continued + + + + + + + + Session Terminated + + + + + + + + + + + + + Originating Session + + + + + + + + Terminating Session for registered user + + + + + + + + Terminating Session for unregistered user + + + + + + + + + + + + + + + + + + + + + + + + + + Identity is a Public User Identity. + + + + + + + + Identity is a distinct Public Service Identity. + + + + + + + + Identity matches a wildcarded Public Service Identity. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scscf/scscf/CxDataType_Rel7.xsd b/scscf/scscf/CxDataType_Rel7.xsd new file mode 100644 index 0000000..b9289e2 --- /dev/null +++ b/scscf/scscf/CxDataType_Rel7.xsd @@ -0,0 +1,301 @@ + + + + + + + + + + + + + + + iFC is part of the registered profile + + + + + + + + iFC is part of the unregistered profile + + + + + + + + + + + + + + + + + + + + + + + Matches to REGISTER messages that are related to initial registration + + + + + + + + Matches to REGISTER messages that are related to re-registration + + + + + + + + Matches to REGISTER messages that are related to de-registration + + + + + + + + + + + + + Session Continued + + + + + + + + Session Terminated + + + + + + + + + + + + + Originating Session + + + + + + + + Terminating Session for registered user + + + + + + + + Terminating Session for unregistered user + + + + + + + + Originating Session for an unregistered user + + + + + + + + + + + + + + + + + + + + + + + + + + Identity is a Public User Identity. + + + + + + + + Identity is a distinct Public Service Identity. + + + + + + + + Identity matches a wildcarded Public Service Identity. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scscf/scscf/CxDataType_Rel8.xsd b/scscf/scscf/CxDataType_Rel8.xsd new file mode 100644 index 0000000..2e057eb --- /dev/null +++ b/scscf/scscf/CxDataType_Rel8.xsd @@ -0,0 +1,379 @@ + + + + + + + + + + + + + + + iFC is part of the registered profile + + + + + + + + iFC is part of the unregistered profile + + + + + + + + + + + + + + + + + + + + + + + Matches to REGISTER messages that are related to initial registration + + + + + + + + Matches to REGISTER messages that are related to re-registration + + + + + + + + Matches to REGISTER messages that are related to de-registration + + + + + + + + + + + + + Session Continued + + + + + + + + Session Terminated + + + + + + + + + + + + + Originating Session + + + + + + + + Terminating Session for registered user + + + + + + + + Terminating Session for unregistered user + + + + + + + + Originating Session for an unregistered user + + + + + + + + + + + + + + + + + + + + + + + + + + Identity is a Public User Identity. + + + + + + + + Identity is a distinct Public Service Identity. + + + + + + + + Identity matches a wildcarded Public Service Identity. + + + + + + + + Identity is a Wildcarded Public User Identity. + + + + + + + + Identity is a Wildcard for Public User Identities. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scscf/scscf/dispatcher.list b/scscf/scscf/dispatcher.list new file mode 100644 index 0000000..7e4bb16 --- /dev/null +++ b/scscf/scscf/dispatcher.list @@ -0,0 +1 @@ +# ng-voice Interconnect diff --git a/scscf/scscf/kamailio_scscf.cfg b/scscf/scscf/kamailio_scscf.cfg new file mode 100644 index 0000000..ba46272 --- /dev/null +++ b/scscf/scscf/kamailio_scscf.cfg @@ -0,0 +1,1276 @@ +#!KAMAILIO +# +# This config file implements the basic P-CSCF functionality +# - web: http://www.kamailio.org +# - git: http://sip-router.org +# +# Refer to the Core CookBook at http://www.kamailio.org/dokuwiki/doku.php +# for an explanation of possible statements, functions and parameters. +# +# Direct your questions about this file to: . +# +# For more information about the various parameters, functions and statements +# try http://sip-router.org/wiki/ . +# + +####### Defined Values ######### +# *** Value defines - IDs used later in config + +# - flags +# FLT_ - per transaction (message) flags +# FLB_ - per branch flags + +#!define FLT_CAPTURE 1 +#!define FLT_DIALOG 2 + +#!define DLG_TIMEOUT_AVP "i:1" +#!define RR_CUSTOM_USER_AVP "i:2" +#!define DISPATCHER_DST_AVP "i:3" +#!define DISPATCHER_GRP_AVP "i:4" +#!define DISPATCHER_CNT_AVP "i:5" +#!define DISPATCHER_SOCK_AVP "i:6" + +####### Global Parameters ######### + +include_file "scscf.cfg" + +#!ifdef WITH_DEBUG +debug=5 +log_stderror=no +sip_warning=yes +#!else +debug=2 +log_stderror=no +sip_warning=no +#!endif + +#!ifdef WITH_XMLRPC +listen=tcp:127.0.0.1:6060 +#!endif + +alias=HOSTNAME + +user_agent_header="User-Agent: Kamailio S-CSCF" +server_header="Server: Kamailio S-CSCF" + +/* comment the next line to enable the auto discovery of local aliases + based on reverse DNS on IPs (default on) */ +auto_aliases=no + +check_via=no # (cmd. line: -v) +dns=no # (cmd. line: -r) +rev_dns=no # (cmd. line: -R) + +# Do SRV-Loadbalancing: +dns_srv_lb=on +# Always: Also try IPv6: +dns_try_ipv6=on +# Always prefer IPv6: +dns_cache_flags=4 +# DNS-Based failover +use_dns_failover=on +# Query NAPTR-Records as well: +dns_try_naptr=on +# DNS cache won't be used (all dns lookups will result into a DNS request) +use_dns_cache=off + +#!ifdef WITH_XMLRPC +#!ifndef WITH_TCP +#!define WITH_TCP +#!endif +#!ifndef TCP_PROCESSES +# Number of TCP Processes +#!define TCP_PROCESSES 3 +#!endif +#!endif + +#!ifdef WITH_TCP +# life time of TCP connection when there is no traffic +# - a bit higher than registration expires to cope with UA behind NAT +tcp_connection_lifetime=3615 +#!ifdef TCP_PROCESSES +tcp_children=TCP_PROCESSES +#!endif +#!else +disable_tcp=yes +#!endif + +children=4 + +system.shutdownmode = 0 desc "System shutdown mode" +system.service = "Serving-CSCF" desc "Function of this server" + +# ------------------ module loading ---------------------------------- +mpath="/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/:/usr/local/lib64/kamailio/modules" +# (we try both the lib64 and the lib directory) + +loadmodule "tm.so" +loadmodule "pv.so" +loadmodule "sl.so" +loadmodule "rr.so" +loadmodule "ims_dialog.so" +loadmodule "textops.so" +loadmodule "textopsx.so" +loadmodule "maxfwd.so" +loadmodule "xlog.so" +loadmodule "sanity.so" +loadmodule "siputils.so" +loadmodule "kex.so" +loadmodule "tmx.so" +loadmodule "pike.so" +#!ifdef DB_URL +loadmodule "presence" +#!endif + +#!ifdef DB_URL +loadmodule "db_mysql" +#!ifdef DB_URL2 +loadmodule "db_cluster" +#!endif +#!endif + +loadmodule "dispatcher" + +loadmodule "enum" +loadmodule "uac" + +# Control interfaces: +loadmodule "ctl" +loadmodule "cfg_rpc" +#!ifdef WITH_XMLRPC +loadmodule "xmlrpc" +#!endif + +loadmodule "cdp.so" +loadmodule "cdp_avp.so" + +loadmodule "ims_usrloc_scscf.so" +loadmodule "ims_registrar_scscf.so" +loadmodule "ims_auth.so" +loadmodule "ims_isc.so" + +#!ifdef WITH_RO +loadmodule "ims_charging.so" +#!endif + +#!ifdef CAPTURE_NODE +loadmodule "siptrace.so" +#!endif + +##!ifdef WITH_DEBUG +loadmodule "debugger.so" +modparam("debugger", "mod_hash_size", 5) +modparam("debugger", "mod_level_mode", 1) +modparam("debugger", "mod_level", "ims_usrloc_scscf=3") +modparam("debugger", "mod_level", "ims_registrar_scscf=3") +modparam("debugger", "mod_level", "ims_auth=3") +modparam("debugger", "mod_level", "ims_isc=3") +modparam("debugger", "mod_level", "ims_dialog=3") +modparam("debugger", "mod_level", "ims_charging=3") +##!endif + +# ----------------- setting module-specific parameters --------------- +#!ifdef DB_URL2 +# ----- db_cluster params ----- +modparam("db_cluster", "connection", DB_URL) +modparam("db_cluster", "connection", DB_URL2) +modparam("db_cluster", "cluster", "cluster1=>con1=2s2s;con2=1s1s") +#!endif + +# ----- presence params ----- +#!ifdef DB_URL +#!ifdef DB_URL2 +modparam("presence", "db_url", "cluster://cluster1") +#!else +modparam("presence", "db_url", DB_URL) +#!endif +#modparam("presence", "fallback2db", 1) +modparam("presence", "db_update_period", 20) +#!endif + +loadmodule "jsonrpcs.so" +# ----- jsonrpcs params ----- +modparam("jsonrpcs", "pretty_format", 1) +/* set the path to RPC fifo control file */ +modparam("jsonrpcs", "fifo_name", "/var/run/kamailio/kamailio_rpc.fifo") +/* set the path to RPC unix socket control file */ +modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio/kamailio_rpc.sock") + +# ----- ctl params ----- +modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl") + +# ----- tm params ----- +# auto-discard branches from previous serial forking leg +modparam("tm", "failure_reply_mode", 3) +# default retransmission timeout: 10sec +modparam("tm", "fr_timer", 10000) +# default invite retransmission timeout after 1xx: 120sec +modparam("tm", "fr_inv_timer", 120000) +# Don't reply automatically with "100 Trying" +modparam("tm", "auto_inv_100", 0) + +# ----- rr params ----- +# add value to ;lr param to cope with most of the UAs +modparam("rr", "enable_full_lr", 1) +# append from tag to the RR +modparam("rr", "append_fromtag", 1) +# add a Username to RR-Header +modparam("rr", "add_username", 1) +# Take User from a custom AVP +modparam("rr", "custom_user_avp", "$avp(RR_CUSTOM_USER_AVP)") + +# -- usrloc params -- +modparam("ims_usrloc_scscf", "enable_debug_file", 0) +modparam("ims_usrloc_scscf", "matching_mode", 0) +modparam("ims_usrloc_scscf", "maxcontact", 1) # set to one as workaround for instable Link +modparam("ims_usrloc_scscf", "maxcontact_3gpp", 1) # set to one as workaround for instable Link +modparam("ims_registrar_scscf", "max_contacts", 5) +modparam("ims_usrloc_scscf", "maxcontact_behaviour", 2) #overwrite +#!ifdef DB_URL +#!ifdef DB_URL2 +modparam("ims_usrloc_scscf", "db_url", "cluster://cluster1") +#!else +modparam("ims_usrloc_scscf", "db_url", DB_URL) +#!endif +modparam("ims_usrloc_scscf", "db_mode", 0) +#!endif +modparam("ims_registrar_scscf", "subscription_default_expires", 654800) +modparam("ims_registrar_scscf", "subscription_min_expires", 3700) +modparam("ims_registrar_scscf", "subscription_max_expires", 605800) + +# -- CDP params -- +modparam("cdp","config_file","/etc/kamailio_scscf/scscf.xml") + +# -- ims_dialog params -- +modparam("ims_dialog", "dlg_flag", FLT_DIALOG) +modparam("ims_dialog", "timeout_avp", "$avp(DLG_TIMEOUT_AVP)") +modparam("ims_dialog", "detect_spirals", 0) +modparam("ims_dialog", "profiles_no_value", "orig ; term") +#!ifdef DB_URL +#!ifdef DB_URL2 +modparam("ims_dialog", "db_url", "cluster://cluster1") +#!else +modparam("ims_dialog", "db_url", DB_URL) +#!endif +modparam("ims_dialog", "db_mode", 0) +#!endif + +#!ifdef WITH_XMLRPC +# ----- xmlrpc params ----- +modparam("xmlrpc", "route", "XMLRPC"); +modparam("xmlrpc", "url_match", "^/RPC") +#!endif + +#!ifdef WITH_DEBUG +# ----- debugger params ----- +modparam("debugger", "cfgtrace", 1) +#!endif + +#!ifdef CAPTURE_NODE +# Destination, where to send the traffic +modparam("siptrace", "duplicate_uri", CAPTURE_NODE) +# Trace all traffic +modparam("siptrace", "trace_on", 1) +modparam("siptrace", "trace_to_database", 0) +modparam("siptrace", "trace_flag", FLT_CAPTURE) +modparam("siptrace", "hep_mode_on", 1) +#!endif + +# -- ims_auth params -- +modparam("ims_auth", "name", URI) +modparam("ims_auth", "registration_default_algorithm", REG_AUTH_DEFAULT_ALG) +#!ifdef CXDX_FORCED_PEER +modparam("ims_auth", "cxdx_forced_peer", CXDX_FORCED_PEER) +#!endif +modparam("ims_auth", "cxdx_dest_realm", NETWORKNAME) +modparam("ims_auth", "av_check_only_impu", 1) + +modparam("ims_auth", "max_nonce_reuse", 20) +modparam("ims_auth", "auth_vector_timeout", 60) +modparam("ims_auth", "auth_data_timeout", 600000) +modparam("ims_auth", "auth_used_vector_timeout", 600000) +modparam("ims_auth", "av_request_at_once", 1) +modparam("ims_auth", "av_request_at_sync", 1) +modparam("ims_auth", "registration_qop", "auth") + +# -- ims_registrar_scscf params -- +#!ifdef WITH_DEBUG +modparam("ims_registrar_scscf", "default_expires", 60) +modparam("ims_registrar_scscf", "min_expires", 60) +modparam("ims_registrar_scscf", "max_expires", 60) +#!else +modparam("ims_registrar_scscf", "default_expires", 604800) +modparam("ims_registrar_scscf", "min_expires", 60) +modparam("ims_registrar_scscf", "max_expires", 604800) +#!endif +modparam("ims_registrar_scscf", "use_path", 1) +modparam("ims_registrar_scscf", "support_wildcardPSI",1) +modparam("ims_registrar_scscf", "user_data_xsd","/etc/kamailio_scscf/CxDataType_Rel7.xsd") +modparam("ims_registrar_scscf", "scscf_name", URI) +modparam("ims_registrar_scscf", "scscf_name", URI) +modparam("ims_registrar_scscf", "cxdx_dest_realm", NETWORKNAME) +modparam("ims_registrar_scscf", "append_branches", 1) +modparam("ims_registrar_scscf", "user_data_always", 0) +modparam("ims_registrar_scscf", "ue_unsubscribe_on_dereg", 1) + +#!ifdef WITH_MULTIDOMAIN +# ----- domain params ----- +#!ifdef DB_URL +#!ifdef DB_URL2 +modparam("domain", "db_url", "cluster://cluster1") +#!else +modparam("domain", "db_url", DB_URL) +#!endif +modparam("domain", "db_mode", 1) +#!endif +# register callback to match myself condition with domains list +modparam("domain", "register_myself", 1) +#!endif + +# ----- ims_isc params ----- +modparam("ims_isc", "my_uri", HOSTNAME) +modparam("ims_isc", "add_p_served_user", 1) + +#!ifdef WITH_RO +# ----- ims_diameter_ro params ----- +#!ifdef DB_URL +#!ifdef DB_URL2 +#modparam("ims_charging", "db_url", "cluster://cluster1") +#!else +#modparam("ims_charging", "db_url", DB_URL) +#!endif +#modparam("ims_charging", "db_mode", 1) +#!endif +modparam("ims_charging", "origin_host", HOSTNAME); +modparam("ims_charging", "origin_realm", NETWORKNAME); +#!ifdef RO_FORCED_PEER +modparam("ims_charging", "ro_forced_peer", RO_FORCED_PEER); +#!endif +modparam("ims_charging", "destination_host", RO_DESTINATION); +modparam("ims_charging", "destination_realm", NETWORKNAME); + +modparam("ims_charging","service_context_id_root", RO_ROOT); +modparam("ims_charging","service_context_id_ext", RO_EXT); +modparam("ims_charging","service_context_id_mnc", RO_MNC); +modparam("ims_charging","service_context_id_mcc", RO_MCC); +modparam("ims_charging","service_context_id_release", RO_RELEASE); + +modparam("ims_charging","interim_update_credits",30); +modparam("ims_charging","timer_buffer",5); +#!endif + +# ----- enum params ----- +modparam("enum", "domain_suffix", "e164.arpa.") + +# ----- sanity params ----- +modparam("sanity", "autodrop", 0) + +# ----------------- Settings for Dispatcher --------------- +modparam("dispatcher", "list_file", "/etc/kamailio_scscf/dispatcher.list") +# Dispatcher: Enable Failover-Support +modparam("dispatcher", "flags", 2) +# Dispatcher: Overwrite Destination address, if required. +modparam("dispatcher", "force_dst", 1) +# AVP's required for Fail-Over-Support: +#modparam("dispatcher", "dst_avp", "$avp(DISPATCHER_DST_AVP)") +#modparam("dispatcher", "grp_avp", "$avp(DISPATCHER_GRP_AVP)") +#modparam("dispatcher", "cnt_avp", "$avp(DISPATCHER_CNT_AVP)") +#modparam("dispatcher", "sock_avp", "$avp(DISPATCHER_SOCK_AVP)") + +#modparam("dispatcher", "xavp_dst", "$avp(DISPATCHER_DST_AVP)") +#modparam("dispatcher", "xavp_dst_mode", 0) +#modparam("dispatcher", "xavp_ctx", "$avp(DISPATCHER_CNT_AVP)") +#modparam("dispatcher", "xavp_ctx_mode", 0) + +# Try to recover disabled destinations every 15 seconds. +modparam("dispatcher", "ds_ping_interval", 15) +# Actively query the gateways: +modparam("dispatcher", "ds_probing_mode", 1) +modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=404;code=480") + +####### Routing Logic ######## +# Main SIP request routing logic +# - processing of any incoming SIP request starts with this route + +route { +##!ifdef WITH_DEBUG + xnotice("SCSCF: $rm $ru ($fu ($si:$sp) to $tu, $ci)\n"); +##!endif + + # per request initial checks + route(REQINIT); + + # Handle Registrations: + if (is_method("REGISTER")) { + route(REGISTER); + exit; + } + + # we need to support subscription to reg event + if (is_method("SUBSCRIBE") && search("^(Event|o)([ \t]*):([ \t]*)reg")) { + route(SUBSCRIBE); + break; + } + + if (is_method("PUBLISH") && search("^(Event|o)([ \t]*):([ \t]*)reg")) { + route(PUBLISH); + break; + } + + # Evaluate Route-Header and set $route_uri + loose_route(); + + if (is_method("CANCEL|ACK")) { + t_relay(); + exit; + } + + #Set DLG flag to track dialogs using dialog2 + if (!is_method("REGISTER|SUBSCRIBE")) + setflag(FLT_DIALOG); + + if (($route_uri =~ "sip:orig@.*") || ($route_uri =~ "sip:orig@"+HOSTNAME_ESC+".*") || isc_from_as("orig")) { + xlog("Orig"); + # we need something like this to assign SCSCF to unregistered user for services + # support for AS origination on behalf of unregistered useri + # can use the registrar is_registered methods - must see if we need to check orig or term? + + # Sanitize the R-URI if domain is present in from of @MSISDN of caller + # What in case of Roaming? - Need to handle it + # if ($ru =~ ".*phone-context.*") { + # if ($ru =~ "tel:.*") { + # # Handle following request-uri + # # tel:0498765432100;phone-context=ims.mnc001.mcc001.3gppnetwork.org + # $ru = $(ru{re.subst,/tel:/sip:/g}); + # } + # # Now in sip: uri format + # if ($ru =~ ".*@.*") { + # $ru = $(ru{re.subst,/@[0-9+-]*;user=phone/@NETWORKNAME;user=phone/g}); + # #$ru = $(ru{re.subst,/;phone-context=[A-Za-z.0-9+-]*@/;phone-context=NETWORKNAME@/g}); + # } else { + # $ru = $ru + "@" + NETWORKNAME + ";user=phone"; + # #$ru = $(ru{re.subst,/;phone-context=[A-Za-z.0-9+-]*@/;phone-context=NETWORKNAME@/g}); + # } + # } + if (!is_method("REGISTER|SUBSCRIBE")) { + # sip:xxx;phone-context=xxxx@xxx format is not desired + if (($ru =~ ".*phone-context.*") && ($ru =~ "sip:.*")) { + $var(old_ruri) = $ru; + $ru = $(ru{re.subst,/sip:/tel:/g}); + $ru = $(ru{re.subst,/;phone-context=[A-Za-z.0-9+-@]*;user=phone//g}); + $ru = $ru + ";phone-context=" + NETWORKNAME; + msg_apply_changes(); + xnotice("SCSCF: Changed R-URI from $var(old_ruri) to $ru\n"); + } + } + + # Originating + route(orig); + break; + } else { + isc_from_as("term"); + if ($retcode == -2) { + # Treat as originating, since it was retargeted: + route(orig); + break; + } + if ((is_in_profile("orig") || has_totag()) && ($route_uri =~ "sip:mo@"+".*")) { + route(orig_subsequent); + break; + } + if ((is_in_profile("term") || has_totag()) && ($route_uri =~ "sip:mt@"+".*")) { + route(term_subsequent); + break; + } + + # Terminating + if (uri == myself || uri =~ "tel:.*") { + if (!term_impu_registered("location")) { + xlog("L_DBG", "We need to do an UNREG server SAR assignemnt"); + assign_server_unreg("UNREG_SAR_REPLY", "location", "term"); + exit; + } else { + sl_send_reply("403","Forbidden - Domain not served"); + exit(); + } + } + route(term); + break; + } +} + +route[UNREG_SAR_REPLY] +{ + xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n"); + switch ($avp(s:saa_return_code)){ + case 1: #success + xlog("L_DBG", "SAR success - will route message\n"); + route(term); + break; + case -1: #failure + xlog("L_ERR", "SAR failure - error response sent from module\n"); + break; + case -2: #error + xlog("L_ERR", "SAR error - error response sent from module\n"); + break; + default: + xlog("L_ERR", "Unknown return code from SAR, value is [$avp(s:saa_return_code)]\n"); + break; + } + exit; +} + + +###################################################################### +# Helper routes (Basic-Checks, NAT-Handling/RTP-Control, XML-RPC) +###################################################################### +# Per SIP request initial checks +route[REQINIT] { + $var(used) = 1 - ($stat(free_size) / $stat(total_size)); + xlog("L_DBG", "Mem: Total $stat(total_size), Free $stat(free_size) [$var(used)% used]\n"); + if ($var(used) > 95) { + send_reply("503", "Server overloaded"); + exit; + } + + # Trace this message +#!ifdef CAPTURE_NODE + sip_trace(); + setflag(FLT_CAPTURE); +#!endif + + if (!mf_process_maxfwd_header("10")) { + sl_send_reply("483","Too Many Hops"); + exit; + } + + if(!sanity_check("1511", "7")) { + xlog("Malformed SIP message from $si:$sp\n"); + exit; + } + + # Check for shutdown mode: + if (!has_totag() && ($sel(cfg_get.system.shutdownmode) > 0)) { + send_reply("503", "Server shutting down"); + exit; + } + + # Reply to OPTIONS: + if (is_method("OPTIONS") && (uri==myself)) { + options_reply(); + exit; + } + + # Ignore Re-Transmits: + if (t_lookup_request()) { + exit; + } + if (is_method("INVITE")) { + send_reply("100", "Trying"); + } + +} + + +###################################################################### +# Publish route +###################################################################### +route[PUBLISH] +{ + if (!t_newtran()) { + #absorb retransmissions + sl_reply("500","Could not create transaction"); + exit; + } + + if (can_publish_reg("location")) { + $var(ret)= publish_reg("location"); + switch ($var(ret)){ + case 1: #success + xlog("L_DBG", "Publish reg successful"); + break; + case -1: #failure + xlog("L_ERR", "Publish reg failure - sending 500 Error now\n"); + t_reply("500","Server Error publishing subscription"); + break; + default: + xlog("L_ERR", "Unknown return code from publish reg event alue is [$var(ret)]\n"); + break; + } + } else { + t_reply("403","Forbidden to PUBLISH"); + exit; + } +} + +###################################################################### +# Subscribe route +###################################################################### +route[SUBSCRIBE] +{ + if (!t_newtran()) { + #absorb retransmissions + sl_reply("500","Could not create transaction"); + exit; + } + + if (!has_totag()) { + xlog("L_DBG", "This is an initial SUBSCRIBE\n"); + if (!term_impu_registered("location")) { + xlog("L_DBG", "We need to do an UNREG server SAR assignment\n"); + assign_server_unreg("SUBSCRIBE_UNREG_SAR_REPLY", "location", "term"); + exit; + } + if (!can_subscribe_to_reg("location")){ + t_reply("403","Forbidden to SUBSCRIBE"); + exit; + } + }else{ + xlog("L_DBG", "This is a subsequent SUBSCRIBE\n"); + } + + $var(ret)= subscribe_to_reg("location"); + switch ($var(ret)){ + case 1: #success + xlog("L_DBG", "Subscribe to reg successful"); + break; + case -1: #failure + xlog("L_ERR", "Subscribe to reg failure - sending 500 Error now\n"); + t_reply("500","Server Error saving subscription"); + break; + case -2: #error + xlog("L_ERR", "Subscribe to reg error sending notify - 200 OK so subscription already sent\n"); + break; + default: + xlog("L_ERR", "Unknown return code from subscribe to reg event alue is [$var(ret)]\n"); + break; + } +} + +route[SUBSCRIBE_UNREG_SAR_REPLY] +{ + + xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n"); + switch ($avp(s:saa_return_code)){ + case 1: #success + xlog("L_DBG", "SAR success - will process subscribe\n"); + if (can_subscribe_to_reg("location")){ + $var(ret)= subscribe_to_reg("location"); + switch ($var(ret)){ + case 1: #success + xlog("L_DBG", "Subscribe to reg successful"); + break; + case -1: #failure + xlog("L_ERR", "Subscribe to reg failure - sending 500 Error now\n"); + t_reply("500","Server Error saving subscription"); + break; + case -2: #error + xlog("L_ERR", "Subscribe to reg error sending notify - 200 OK so subscription already sent\n"); + break; + default: + xlog("L_ERR", "Unknown return code from subscribe to reg event alue is [$var(ret)]\n"); + break; + } + }else{ + t_reply("403","Forbidden to SUBSCRIBE"); + exit; + } + break; + case -1: #failure + xlog("L_ERR", "SAR failure - Sending 403 Forbidden\n"); + t_reply("403","Forbidden to SUBSCRIBE"); + break; + case -2: #error + xlog("L_ERR", "SAR error - Sending 403 Forbidden\n"); + t_reply("403","Forbidden to SUBSCRIBE"); + break; + default: + xlog("L_ERR", "Unknown return code from SAR, value is [$avp(s:saa_return_code)] - sending 403 Forbidden\n"); + t_reply("403","Forbidden to SUBSCRIBE"); + break; + } + exit; +} + +###################################################################### +# XMLRPC routing +###################################################################### +#!ifdef WITH_XMLRPC +route[XMLRPC] { + if ((method=="POST" || method=="GET") +#!ifdef XMLRPC_WHITELIST_1 +&& ((src_ip == XMLRPC_WHITELIST_1) +#!ifdef XMLRPC_WHITELIST_2 + || (src_ip == XMLRPC_WHITELIST_2) +#!endif +#!ifdef XMLRPC_WHITELIST_3 + || (src_ip == XMLRPC_WHITELIST_3) +#!endif +) +#!endif +) { + # close connection only for xmlrpclib user agents (there is a bug in + # xmlrpclib: it waits for EOF before interpreting the response). + if ($hdr(User-Agent) =~ "xmlrpclib") + set_reply_close(); + set_reply_no_connect(); + dispatch_rpc(); + exit; + } + send_reply("403", "Forbidden"); + exit; +} +#!endif + +###################################################################### +# Route for handling Registrations: +###################################################################### +route[REGISTER] { + xnotice("ALGORITHM IS [$aa] and User-Agent is [$ua]\n"); + $var(alg) = $aa; + if ($aa == $null) { + $var(alg) = "MD5"; #force to MD5 for zoiper.... non-ims + } +#!ifdef WITH_AUTH + if (!ims_www_authenticate("$td")) { +#!else + if (($var(alg) == "MD5") && (!ims_www_authenticate("$td"))) { +#!endif + if ($? == -2) { + send_reply("403", "Authentication Failed"); + exit; + } else if ($? == -3) { + send_reply("400", "Bad Request"); + exit; + } else if ($? == -9) { + xlog("L_DBG", "Authentication re-sync requested\n"); + ims_www_resync_auth("REG_RESYNC_REPLY", "$td"); + exit; + } else { + #user has not been authenticated. Lets send a challenge via 401 Unauthorized + xlog("L_DBG","About to challenge! auth_ims\n"); + ims_www_challenge("REG_MAR_REPLY", "$td", "$var(alg)"); + exit; + } + } else { + xlog("L_DBG", "Auth succeeded\n"); + # We need to check if this user is registered or not + if (!impu_registered("location")) { + xlog("L_ERR", "Not REGISTERED\n"); + save("PRE_REG_SAR_REPLY","location"); + exit; + } else { + isc_match_filter_reg("1","location"); + save("REG_SAR_REPLY","location"); + exit; + } + } +} + +route[REG_MAR_REPLY] +{ + #this is async so to know status we have to check the reply avp + xlog("L_DBG","maa_return code is $avp(s:maa_return_code)\n"); + + switch ($avp(s:maa_return_code)){ + case 1: #success + xlog("L_DBG", "MAR success - 401/407 response sent from module\n"); + break; + case -1: #failure + xlog("L_ERR", "MAR failure - error response sent from module\n"); + break; + case -2: #error + xlog("L_ERR", "MAR error - sending error response now\n"); + send_reply("500", "MAR failed"); + break; + default: + xlog("L_ERR", "Unknown return code from MAR, value is [$avp(s:maa_return_code)]\n"); + send_reply("500", "Unknown response code from MAR"); + break; + } + exit; +} + +route[PRE_REG_SAR_REPLY] +{ + xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n"); + #this is async so to know status we have to check the reply avp + xlog("L_DBG","saa_return code (for scscf_save on register) is $avp(s:saa_return_code)\n"); + switch ($avp(s:saa_return_code)){ + case 1: #success + xlog("L_DBG", "SAR success - 200 response sent from module\n"); + isc_match_filter_reg("0","location"); + exit; + case -1: #failure + xlog("L_ERR", "SAR failure - error response sent from module\n"); + break; + case -2: #error + xlog("L_ERR", "SAR error - error response sent from module\n"); + break; + default: + xlog("L_ERR", "Unknown return code from SAR, value is [$avp(s:saa_return_code)]\n"); + break; + } + exit; +} + +route[REG_SAR_REPLY] +{ + xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n"); + #this is async so to know status we have to check the reply avp + xlog("L_DBG","saa_return code (for scscf_save on register) is $avp(s:saa_return_code)\n"); + switch ($avp(s:saa_return_code)){ + case 1: #success + xlog("L_DBG", "SAR success - 200 response sent from module\n"); + exit; + case -1: #failure + xlog("L_ERR", "SAR failure - error response sent from module\n"); + break; + case -2: #error + xlog("L_ERR", "SAR error - error response sent from module\n"); + break; + default: + xlog("L_ERR", "Unknown return code from SAR, value is [$avp(s:saa_return_code)]\n"); + break; + } + exit; +} + +route[REG_RESYNC_REPLY] +{ + ims_www_challenge("REG_MAR_REPLY", "$td"); +} + +###################################################################### +# Apply privacy, if requested +###################################################################### +route[apply_privacy] +{ + if (is_present_hf("Privacy") && ($hdr(Privacy)=="id")) { + remove_hf("P-Asserted-Identity"); + } +} + +###################################################################### +# Originating, Intial Requests +###################################################################### +route[orig] +{ + xlog("L_DBG","Enter orig route\n"); + set_dlg_profile("orig"); + + # we MAYBE need something like this to check if a user is barred + # if (S_originating_barred()){ + # sl_send_reply("403","Forbidden - Originating Public Identity barred"); + # exit; + # } + + if (is_method("INVITE|SUBSCRIBE")) { + $avp(RR_CUSTOM_USER_AVP)="mo"; + record_route(); + } + + # Start new transaction: + t_newtran(); + + # check if dialog saved as fwded to AS + if (isc_match_filter("orig", "location")) { + t_on_failure("isc_orig_failure"); + xlog("Orig - msg was fwded to AS\n"); + exit; + } + + if (!isc_from_as("orig")) { + remove_hf("P-Asserted-Identity"); + append_hf("P-Asserted-Identity: \r\n"); + } + +#!ifdef WITH_RO + # before we allow call - lets check credit + if (is_method("INVITE")) { + xlog("L_DBG","Sending initial CCR Request for call\n"); + $var(cc_ret) = Ro_CCR("CHARGING_CCR_ORIG_REPLY", "orig", 30, "0", "0"); + if ($var(cc_ret) < 0) { + xlog("L_ERR","CCR Request failure\n"); + sl_send_reply("402","Payment required"); + exit; + } + xlog("L_DBG","CCR Request success\n"); + exit; + } +#!endif + route(FINAL_ORIG); +} + +route[FINAL_ORIG] +{ + # Check for PSTN destinations: + if (is_method("INVITE")) { + route(PSTN_handling); + } + + t_on_reply("orig_reply"); + + t_relay(); +} + +route[CHARGING_CCR_ORIG_REPLY] +{ + xlog("L_DBG","cca_return code is $avp(s:cca_return_code)\n"); + + switch ($avp(s:cca_return_code)){ + case 1: #success + xlog("L_DBG", "CCR success - will route message\n"); + route(FINAL_ORIG); + break; + case -1: #failure + xlog("L_ERR", "CCR failure - error response sent from module\n"); + switch ($avp(s:cca_result_code)){ + case 5030: + send_reply("403", "Charging User not found"); + break; + case 5031: + send_reply("403", "Rating failed"); + break; + case 4010: + send_reply("402", "Payment required - Unsufficient funds"); + break; + case 5006: + send_reply("486", "Line limit exceeded"); + break; + default: + send_reply("402","Payment required ($avp(s:cca_result_code))"); + break; + } + case -2: #error + xlog("L_ERR", "CCR error - error response sent from module\n"); + send_reply("500", "Charging Error"); + break; + default: + xlog("L_ERR", "Unknown return code from CCR: [$avp(s:cca_return_code)] \n"); + send_reply("500", "Charging Error"); + break; + } + exit; +} + + +###################################################################### +# Replies to the Initial Requests +###################################################################### +onreply_route[orig_reply] +{ + xlog("L_DBG","Orig reply\n"); + + route(apply_privacy); + break; +} + +###################################################################### +# Originating, subsequent requests +###################################################################### +route[orig_subsequent] +{ + xlog("L_DBG","Orig_Subsequent\n"); + + if (!is_method("ACK")) { + t_on_reply("orig_subsequent_reply"); + } + t_relay(); +} + +###################################################################### +# Replies for originating, subsequent requests +###################################################################### +onreply_route[orig_subsequent_reply] +{ + xlog("L_DBG","Orig_Subsequent_reply\n"); + route(apply_privacy); + break; +} + +###################################################################### +# Failure-Route for Requests to an AS +###################################################################### +failure_route[isc_orig_failure] +{ + xlog("L_DBG","ISC_Orig_failure\n"); + + if (t_check_status("(408)|(5..)")){ + t_on_failure("isc_orig_failure"); + if (isc_match_filter("orig","location")){ + xlog("L_DBG","ISC_Orig_failure - msg was fwded to AS\n"); + exit; + } + + if (isc_from_as("origfail")) { + remove_hf("P-Asserted-Identity"); + append_hf("P-Asserted-Identity: \r\n"); + } + + t_on_reply("orig_reply"); + + t_relay(); + } +} + +###################################################################### +# Terminating requests +###################################################################### +route[term] +{ + xlog("L_DBG","Term\n"); + + set_dlg_profile("term"); + + #we need something like this to check if a user is barred + # if (S_terminating_barred()){ + # sl_send_reply("404","Not Found - Terminating user barred"); + # exit; + # } + + if (is_method("INVITE|SUBSCRIBE")) { + $avp(RR_CUSTOM_USER_AVP)="mt"; + $avp(i:20)="mt"; + record_route(); + } + + # check if dialog saved as fwded to AS + if (isc_match_filter("term","location")){ + t_on_failure("isc_term_failure"); + xlog("L_DBG","Term - msg was fwded to AS\n"); + exit; + } + +#!ifdef WITH_RO_TERM + # before we allow call - lets check credit + if (is_method("INVITE")) { + xlog("L_DBG","Sending initial CCR Request for call\n"); + $var(cc_ret) = Ro_CCR("CHARGING_CCR_TERM_REPLY", "term", 30, "0", "0"); + if ($var(cc_ret) < 0) { + xlog("L_ERR","CCR Request failure\n"); + sl_send_reply("402","Payment required"); + exit; + } + xlog("L_DBG","CCR Request success\n"); + exit; + } +#!endif + route(FINAL_TERM); +} + +route[FINAL_TERM] { + if (lookup("location")) { + if (uri==myself) { + if (!t_newtran()) { + sl_reply_error(); + exit; + } + t_reply("404","Not Found - destination user not found on this S-CSCF"); + exit; + } + } else { + # User not registered? Reply with 404. + if (!t_newtran()) { + sl_reply_error(); + exit; + } + t_reply("404","Not Found - destination user not found on this S-CSCF"); + exit; + } + route(apply_privacy); + + t_relay(); +} + + +route[CHARGING_CCR_TERM_REPLY] +{ + xlog("L_DBG","cca_return code is $avp(s:cca_return_code)\n"); + + switch ($avp(s:cca_return_code)){ + case 1: #success + xlog("L_DBG", "CCR success - will route message\n"); + route(FINAL_TERM); + break; + case -1: #failure + xlog("L_ERR", "CCR failure - error response sent from module\n"); + switch ($avp(s:cca_result_code)){ + case 5030: + send_reply("403", "Charging User not found"); + break; + case 5031: + send_reply("403", "Rating failed"); + break; + case 4010: + send_reply("402", "Payment required - Unsufficient funds"); + break; + case 5006: + send_reply("486", "Line limit exceeded"); + break; + default: + send_reply("402","Payment required ($avp(s:cca_result_code))"); + break; + } + case -2: #error + xlog("L_ERR", "CCR error - error response sent from module\n"); + send_reply("500", "Charging Error"); + break; + default: + xlog("L_ERR", "Unknown return code from CCR: [$avp(s:cca_return_code)] \n"); + send_reply("500", "Charging Error"); + break; + } + exit; +} + + +###################################################################### +# Failure Route for Terminating requests +###################################################################### +failure_route[isc_term_failure] +{ + xlog("L_DBG","ISC_term_failure\n"); + + if (t_check_status("(408)|(5..)")){ + t_on_failure("isc_term_failure"); + if (isc_match_filter("term","location")){ + xlog("L_DBG","Term - msg was fwded to AS\n"); + exit; + } + + if (lookup("location")) { + if (uri==myself) { + t_reply("404","Not Found - destination user not found on this S-CSCF"); + exit; + } + } else { + t_reply("404","Not Found - destination user not found on this S-CSCF"); + exit; + } + t_relay(); + } +} + +###################################################################### +# Terminating, subsequent requests +###################################################################### +route[term_subsequent] +{ + xlog("L_DBG","term_subsequent\n"); + route(apply_privacy); + t_relay(); +} + +###################################################################### +# Check for PSTN destinations: +###################################################################### +route[PSTN_handling] +{ + # First, we translate "tel:"-URI's to SIP-URI's: + # $ru: tel:+(34)-999-888-777 + # $fu: sip:test@foo.com + # becomes $ru: sip:+34999888777@foo.com;user=phone + if (tel2sip2("$ru", "$fd", "$ru") < 0) + xlog("L_WARN","Failed to convert $ru to a sip:-URI - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n"); + + if ($rU =~ "\+[0-9]+") { + # Now let's check, if the number can be found in ENUM: + if(!enum_query()) { + # ENUM failed, send it to the PSTN-Gateway: + route(PSTN); + break; + } + } +} + +###################################################################### +# Send calls to the PSTN-Gateways: +###################################################################### +route[PSTN] +{ + $var(has_trf) = 0; + if (is_present_hf("Feature-Caps")) { + xlog("Feature-Caps: $hdr(Feature-Caps) => $(hdr(Feature-Caps){param.value,+g.3gpp.trf}{nameaddr.uri}{uri.host})\n"); + if ($(hdr(Feature-Caps){param.value,+g.3gpp.trf}) != $null) { + $rd = $(hdr(Feature-Caps){param.value,+g.3gpp.trf}{nameaddr.uri}{uri.host}); + if (!strempty($(ou{uri.params}))) { + $ru = $ru+";"+$(ou{uri.params}); + } + + t_on_failure("TRF_failure"); + if (t_relay_to("0x02")) { + $var(has_trf) = 1; + } else { + xlog("Relay to $du failed.\n"); + $du = $null; + } + } + } + + if ($var(has_trf) == 0) { + if (!ds_select_domain("1", "4")) { + xlog("L_WARN","No PSTN-Gateways available - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n"); + send_reply("503", "Service not available"); + exit; + } + if (!strempty($(ou{uri.params}))) { + $ru = $ru+";"+$(ou{uri.params}); + } + t_relay(); + } + # Relay the request: + t_on_failure("PSTN_failure"); + + exit; +} + +###################################################################### +# manage failure routing cases, perform failover +###################################################################### +failure_route[TRF_failure] { + xlog("TRF_failure\n"); + # Choose another gateway, in case we + # - get a local generated "408" + # - receive a 5xx or 6xx reply from the proxy. + if (t_branch_timeout() || t_check_status("[5-6]..")) { + $du = $null; + if (!ds_select_domain("1", "4")) { + xlog("L_WARN","No PSTN-Gateways available - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n"); + send_reply("503", "Service not available"); + exit; + } + if (!strempty($(ou{uri.params}))) { + $ru = $ru+";"+$(ou{uri.params}); + } + # Relay the request: + t_on_failure("PSTN_failure"); + + t_relay(); + exit; + } +} + +###################################################################### +# manage failure routing cases, perform failover +###################################################################### +failure_route[PSTN_failure] { + # Choose another gateway, in case we + # - get a local generated "408" + # - receive a 5xx or 6xx reply from the proxy. + if (t_branch_timeout() || t_check_status("[5-6]..")) { + if (ds_next_domain()) { + if (!strempty($(ou{uri.params}))) { + $ru = $ru+";"+$(ou{uri.params}); + } + # Do Failover in case problems: + t_on_failure("PSTN_failure"); + t_relay(); + } else { + # Add a header, to indicate the phone should try again in 30 seconds. + append_hf("Retry-After: 30\r\n"); + send_reply("503", "Service not available"); + } + exit; + } +} diff --git a/scscf/scscf/scscf.cfg b/scscf/scscf/scscf.cfg new file mode 100644 index 0000000..3fae63b --- /dev/null +++ b/scscf/scscf/scscf.cfg @@ -0,0 +1,84 @@ +# SIP / UDP +listen=udp:SCSCF_IP:6060 +# SIP / TCP +listen=tcp:SCSCF_IP:6060 +# SIP / TCP/TLS +#listen=tls:SCSCF_IP:6061 + +#!define NETWORKNAME "IMS_DOMAIN" +#!define NETWORKNAME_ESC "IMS_SLASH_DOMAIN" +#!define HOSTNAME "scscf.IMS_DOMAIN" +#!define HOSTNAME_ESC "scscf\.IMS_SLASH_DOMAIN" +#!define URI "sip:scscf.IMS_DOMAIN:6060" + +#!subst "/NETWORKNAME/IMS_DOMAIN/" + +alias=scscf.IMS_DOMAIN + +# ENUM-Server to query: +#!define ENUM_SUFFIX "IMS_DOMAIN." + +# SIP-Address of capturing node, if not set, capturing is disabled. +##!define CAPTURE_NODE "sip:127.0.0.1:9060" + +# Connection URL for the database: +# For use with a single database: +#!define DB_URL "mysql://scscf:heslo@MYSQL_IP/scscf" + +# For use with DB_Cluster: con1 (primary), con2 (backup) +##!define DB_URL "con1=>mysql://scscf:heslo@MYSQL_IP/scscf" +##!define DB_URL2 "con2=>mysql://scscf:heslo@MYSQL_IP/scscf" + +# Select Authorization Algorhithm: +##!define REG_AUTH_DEFAULT_ALG "AKAv1-MD5" +##!define REG_AUTH_DEFAULT_ALG "AKAv2-MD5" +##!define REG_AUTH_DEFAULT_ALG "MD5" +##!define REG_AUTH_DEFAULT_ALG "CableLabs-Digest" +##!define REG_AUTH_DEFAULT_ALG "3GPP-Digest" +##!define REG_AUTH_DEFAULT_ALG "TISPAN-HTTP_DIGEST_MD5" +# Let the HSS decide +#!define REG_AUTH_DEFAULT_ALG "HSS-Selected" + +# Number of TCP Processes +#!define TCP_PROCESSES 3 + +##!define RO_FORCED_PEER "32260@3gpp.org" +#!define RO_DESTINATION "hssocs.voiceblue.com" +#!define RO_ROOT "32260@3gpp.org" +#!define RO_EXT "ext" +#!define RO_MNC "02" +#!define RO_MCC "001" +#(see https://en.wikipedia.org/wiki/Mobile_country_code_(MCC)) +#!define RO_RELEASE "8" +# See http://tools.ietf.org/html/rfc4006#section-4.1.2 for the definition of the Service-Context + +##!define XMLRPC_WHITELIST_1 "127.0.0.1" +##!define XMLRPC_WHITELIST_2 "127.0.0.1" +##!define XMLRPC_WHITELIST_3 "127.0.0.1" + +# Several features can be enabled using '#!define WITH_FEATURE' directives: +# +# *** To run in debug mode: +# - define WITH_DEBUG +# +# *** To enable TCP support execute: +# - define WITH_TCP +# +# *** To enable XMLRPC support execute: +# - define WITH_XMLRPC +# - this will automagically enable TCP +# +# *** To enable the Ro-Interface: +# - Configure Ro-Diameter-Interface in scscf.xml +# - define WITH_RO +# +# *** To enable a Homer SIP-Capter-Node: +# - define CAPTURE_NODE with a proper address +# +# Enabled Features for this host: +##!define WITH_DEBUG +#!define WITH_TCP +##!define WITH_XMLRPC +##!define WITH_RO +##!define WITH_RO_TERM +#!define WITH_AUTH diff --git a/scscf/scscf/scscf.xml b/scscf/scscf/scscf.xml new file mode 100644 index 0000000..d282882 --- /dev/null +++ b/scscf/scscf/scscf.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/scscf/scscf/scscf_init.sh b/scscf/scscf/scscf_init.sh new file mode 100755 index 0000000..2fd4a23 --- /dev/null +++ b/scscf/scscf/scscf_init.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +# BSD 2-Clause License + +# Copyright (c) 2020, Supreeth Herle +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: + +# 1. Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. + +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +[ ${#MNC} == 3 ] && IMS_DOMAIN="ims.mnc${MNC}.mcc${MCC}.3gppnetwork.org" || IMS_DOMAIN="ims.mnc0${MNC}.mcc${MCC}.3gppnetwork.org" + +mkdir -p /etc/kamailio_scscf +cp /mnt/scscf/scscf.cfg /etc/kamailio_scscf +cp /mnt/scscf/scscf.xml /etc/kamailio_scscf +cp /mnt/scscf/kamailio_scscf.cfg /etc/kamailio_scscf +cp /mnt/scscf/CxDataType_Rel6.xsd /etc/kamailio_scscf +cp /mnt/scscf/CxDataType_Rel7.xsd /etc/kamailio_scscf +cp /mnt/scscf/CxDataType_Rel8.xsd /etc/kamailio_scscf +cp /mnt/scscf/dispatcher.list /etc/kamailio_scscf + +while ! mysqladmin ping -h ${MYSQL_IP} --silent; do + sleep 5; +done + +# Sleep until permissions are set +sleep 10; + +# Create SCSCF database, populate tables and grant privileges +if [[ -z "`mysql -u root -h ${MYSQL_IP} -qfsBe "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='scscf'" 2>&1`" ]]; +then + mysql -u root -h ${MYSQL_IP} -e "create database scscf;" + mysql -u root -h ${MYSQL_IP} scscf < /usr/local/src/kamailio/utils/kamctl/mysql/standard-create.sql + mysql -u root -h ${MYSQL_IP} scscf < /usr/local/src/kamailio/utils/kamctl/mysql/presence-create.sql + mysql -u root -h ${MYSQL_IP} scscf < /usr/local/src/kamailio/utils/kamctl/mysql/ims_usrloc_scscf-create.sql + mysql -u root -h ${MYSQL_IP} scscf < /usr/local/src/kamailio/utils/kamctl/mysql/ims_dialog-create.sql + mysql -u root -h ${MYSQL_IP} scscf < /usr/local/src/kamailio/utils/kamctl/mysql/ims_charging-create.sql + SCSCF_USER_EXISTS=`mysql -u root -h ${MYSQL_IP} -s -N -e "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE User = 'scscf' AND Host = '%')"` + if [[ "$SCSCF_USER_EXISTS" == 0 ]] + then + mysql -u root -h ${MYSQL_IP} -e "CREATE USER 'scscf'@'%' IDENTIFIED WITH mysql_native_password BY 'heslo'"; + mysql -u root -h ${MYSQL_IP} -e "CREATE USER 'scscf'@'$SCSCF_IP' IDENTIFIED WITH mysql_native_password BY 'heslo'"; + mysql -u root -h ${MYSQL_IP} -e "GRANT ALL ON scscf.* TO 'scscf'@'%'"; + mysql -u root -h ${MYSQL_IP} -e "GRANT ALL ON scscf.* TO 'scscf'@'$SCSCF_IP'"; + mysql -u root -h ${MYSQL_IP} -e "FLUSH PRIVILEGES;" + fi +fi + +export IMS_SLASH_DOMAIN=`echo $IMS_DOMAIN | sed 's/\./\\\./g'` + +sed -i 's|SCSCF_IP|'$SCSCF_IP'|g' /etc/kamailio_scscf/scscf.cfg +sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_scscf/scscf.cfg +sed -i 's|IMS_SLASH_DOMAIN|'$IMS_SLASH_DOMAIN'|g' /etc/kamailio_scscf/scscf.cfg +sed -i 's|MYSQL_IP|'$MYSQL_IP'|g' /etc/kamailio_scscf/scscf.cfg + +sed -i 's|SCSCF_IP|'$SCSCF_IP'|g' /etc/kamailio_scscf/scscf.xml +sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_scscf/scscf.xml +sed -i 's|PYHSS_BIND_PORT|'$PYHSS_BIND_PORT'|g' /etc/kamailio_scscf/scscf.xml +sed -i 's|SCSCF_BIND_PORT|'$SCSCF_BIND_PORT'|g' /etc/kamailio_scscf/scscf.xml + +# Sync docker time +#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone From 4535f3c7ee2e7e90ca165203f9468481b7095e2a Mon Sep 17 00:00:00 2001 From: Abdulkarim Barbour <63456208+NUCLEAR-WAR@users.noreply.github.com> Date: Wed, 1 Jan 2025 03:34:26 +0100 Subject: [PATCH 04/14] comenting out IBCF, uncoment only if needed comenting out IBCF, uncoment only if needed --- sa-vonr-deploy.yaml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sa-vonr-deploy.yaml b/sa-vonr-deploy.yaml index 2ad7cef..9eb829a 100644 --- a/sa-vonr-deploy.yaml +++ b/sa-vonr-deploy.yaml @@ -506,28 +506,28 @@ services: networks: default: ipv4_address: ${GRAFANA_IP} - ibcf: - build: ./ibcf - image: ibcf_cloud - container_name: ibcf_voicemail - dns: ${DNS_IP} - privileged: true - env_file: - - .env - volumes: - - ./ibcf:/mnt/ibcf - environment: - - COMPONENT_NAME=ibcf_voicemail - expose: - - "5090/tcp" - - "5090/udp" - - "10000-10100/udp" - ports: - - "5090:5090/tcp" - - "10000-10100:10000-10100/udp" - networks: - default: - ipv4_address: ${IBCF_IP} +# ibcf: +# build: ./ibcf +# image: ibcf_cloud +# container_name: ibcf_voicemail +# dns: ${DNS_IP} +# privileged: true +# env_file: +# - .env +# volumes: +# - ./ibcf:/mnt/ibcf +# environment: +# - COMPONENT_NAME=ibcf_voicemail +# expose: +# - "5090/tcp" +# - "5090/udp" +# - "10000-10100/udp" +# ports: +# - "5090:5090/tcp" +# - "10000-10100:10000-10100/udp" +# networks: +# default: +# ipv4_address: ${IBCF_IP} networks: default: From dbc3b2e321f6e70fafdf9748f647d5037b745ee2 Mon Sep 17 00:00:00 2001 From: local_dev_user Date: Wed, 1 Jan 2025 02:46:19 +0000 Subject: [PATCH 05/14] fix wronglly pushed files --- scscf/kamailio_scscf.cfg | 2 +- scscf/scscf/CxDataType_Rel6.xsd | 293 ------- scscf/scscf/CxDataType_Rel7.xsd | 301 -------- scscf/scscf/CxDataType_Rel8.xsd | 379 --------- scscf/scscf/dispatcher.list | 1 - scscf/scscf/kamailio_scscf.cfg | 1276 ------------------------------- scscf/scscf/scscf.cfg | 84 -- scscf/scscf/scscf.xml | 36 - scscf/scscf/scscf_init.sh | 80 -- 9 files changed, 1 insertion(+), 2451 deletions(-) delete mode 100644 scscf/scscf/CxDataType_Rel6.xsd delete mode 100644 scscf/scscf/CxDataType_Rel7.xsd delete mode 100644 scscf/scscf/CxDataType_Rel8.xsd delete mode 100644 scscf/scscf/dispatcher.list delete mode 100644 scscf/scscf/kamailio_scscf.cfg delete mode 100644 scscf/scscf/scscf.cfg delete mode 100644 scscf/scscf/scscf.xml delete mode 100755 scscf/scscf/scscf_init.sh diff --git a/scscf/kamailio_scscf.cfg b/scscf/kamailio_scscf.cfg index 8c756ac..ba46272 100644 --- a/scscf/kamailio_scscf.cfg +++ b/scscf/kamailio_scscf.cfg @@ -360,7 +360,7 @@ modparam("ims_charging","timer_buffer",5); #!endif # ----- enum params ----- -modparam("enum", "domain_suffix", ENUM_SUFFIX) +modparam("enum", "domain_suffix", "e164.arpa.") # ----- sanity params ----- modparam("sanity", "autodrop", 0) diff --git a/scscf/scscf/CxDataType_Rel6.xsd b/scscf/scscf/CxDataType_Rel6.xsd deleted file mode 100644 index 3eb21b7..0000000 --- a/scscf/scscf/CxDataType_Rel6.xsd +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - iFC is part of the registered profile - - - - - - - - iFC is part of the unregistered profile - - - - - - - - - - - - - - - - - - - - - - - Matches to REGISTER messages that are related to initial registration - - - - - - - - Matches to REGISTER messages that are related to re-registration - - - - - - - - Matches to REGISTER messages that are related to de-registration - - - - - - - - - - - - - Session Continued - - - - - - - - Session Terminated - - - - - - - - - - - - - Originating Session - - - - - - - - Terminating Session for registered user - - - - - - - - Terminating Session for unregistered user - - - - - - - - - - - - - - - - - - - - - - - - - - Identity is a Public User Identity. - - - - - - - - Identity is a distinct Public Service Identity. - - - - - - - - Identity matches a wildcarded Public Service Identity. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scscf/scscf/CxDataType_Rel7.xsd b/scscf/scscf/CxDataType_Rel7.xsd deleted file mode 100644 index b9289e2..0000000 --- a/scscf/scscf/CxDataType_Rel7.xsd +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - - - - - - - - - - iFC is part of the registered profile - - - - - - - - iFC is part of the unregistered profile - - - - - - - - - - - - - - - - - - - - - - - Matches to REGISTER messages that are related to initial registration - - - - - - - - Matches to REGISTER messages that are related to re-registration - - - - - - - - Matches to REGISTER messages that are related to de-registration - - - - - - - - - - - - - Session Continued - - - - - - - - Session Terminated - - - - - - - - - - - - - Originating Session - - - - - - - - Terminating Session for registered user - - - - - - - - Terminating Session for unregistered user - - - - - - - - Originating Session for an unregistered user - - - - - - - - - - - - - - - - - - - - - - - - - - Identity is a Public User Identity. - - - - - - - - Identity is a distinct Public Service Identity. - - - - - - - - Identity matches a wildcarded Public Service Identity. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scscf/scscf/CxDataType_Rel8.xsd b/scscf/scscf/CxDataType_Rel8.xsd deleted file mode 100644 index 2e057eb..0000000 --- a/scscf/scscf/CxDataType_Rel8.xsd +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - - - - - - - - - - iFC is part of the registered profile - - - - - - - - iFC is part of the unregistered profile - - - - - - - - - - - - - - - - - - - - - - - Matches to REGISTER messages that are related to initial registration - - - - - - - - Matches to REGISTER messages that are related to re-registration - - - - - - - - Matches to REGISTER messages that are related to de-registration - - - - - - - - - - - - - Session Continued - - - - - - - - Session Terminated - - - - - - - - - - - - - Originating Session - - - - - - - - Terminating Session for registered user - - - - - - - - Terminating Session for unregistered user - - - - - - - - Originating Session for an unregistered user - - - - - - - - - - - - - - - - - - - - - - - - - - Identity is a Public User Identity. - - - - - - - - Identity is a distinct Public Service Identity. - - - - - - - - Identity matches a wildcarded Public Service Identity. - - - - - - - - Identity is a Wildcarded Public User Identity. - - - - - - - - Identity is a Wildcard for Public User Identities. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scscf/scscf/dispatcher.list b/scscf/scscf/dispatcher.list deleted file mode 100644 index 7e4bb16..0000000 --- a/scscf/scscf/dispatcher.list +++ /dev/null @@ -1 +0,0 @@ -# ng-voice Interconnect diff --git a/scscf/scscf/kamailio_scscf.cfg b/scscf/scscf/kamailio_scscf.cfg deleted file mode 100644 index ba46272..0000000 --- a/scscf/scscf/kamailio_scscf.cfg +++ /dev/null @@ -1,1276 +0,0 @@ -#!KAMAILIO -# -# This config file implements the basic P-CSCF functionality -# - web: http://www.kamailio.org -# - git: http://sip-router.org -# -# Refer to the Core CookBook at http://www.kamailio.org/dokuwiki/doku.php -# for an explanation of possible statements, functions and parameters. -# -# Direct your questions about this file to: . -# -# For more information about the various parameters, functions and statements -# try http://sip-router.org/wiki/ . -# - -####### Defined Values ######### -# *** Value defines - IDs used later in config - -# - flags -# FLT_ - per transaction (message) flags -# FLB_ - per branch flags - -#!define FLT_CAPTURE 1 -#!define FLT_DIALOG 2 - -#!define DLG_TIMEOUT_AVP "i:1" -#!define RR_CUSTOM_USER_AVP "i:2" -#!define DISPATCHER_DST_AVP "i:3" -#!define DISPATCHER_GRP_AVP "i:4" -#!define DISPATCHER_CNT_AVP "i:5" -#!define DISPATCHER_SOCK_AVP "i:6" - -####### Global Parameters ######### - -include_file "scscf.cfg" - -#!ifdef WITH_DEBUG -debug=5 -log_stderror=no -sip_warning=yes -#!else -debug=2 -log_stderror=no -sip_warning=no -#!endif - -#!ifdef WITH_XMLRPC -listen=tcp:127.0.0.1:6060 -#!endif - -alias=HOSTNAME - -user_agent_header="User-Agent: Kamailio S-CSCF" -server_header="Server: Kamailio S-CSCF" - -/* comment the next line to enable the auto discovery of local aliases - based on reverse DNS on IPs (default on) */ -auto_aliases=no - -check_via=no # (cmd. line: -v) -dns=no # (cmd. line: -r) -rev_dns=no # (cmd. line: -R) - -# Do SRV-Loadbalancing: -dns_srv_lb=on -# Always: Also try IPv6: -dns_try_ipv6=on -# Always prefer IPv6: -dns_cache_flags=4 -# DNS-Based failover -use_dns_failover=on -# Query NAPTR-Records as well: -dns_try_naptr=on -# DNS cache won't be used (all dns lookups will result into a DNS request) -use_dns_cache=off - -#!ifdef WITH_XMLRPC -#!ifndef WITH_TCP -#!define WITH_TCP -#!endif -#!ifndef TCP_PROCESSES -# Number of TCP Processes -#!define TCP_PROCESSES 3 -#!endif -#!endif - -#!ifdef WITH_TCP -# life time of TCP connection when there is no traffic -# - a bit higher than registration expires to cope with UA behind NAT -tcp_connection_lifetime=3615 -#!ifdef TCP_PROCESSES -tcp_children=TCP_PROCESSES -#!endif -#!else -disable_tcp=yes -#!endif - -children=4 - -system.shutdownmode = 0 desc "System shutdown mode" -system.service = "Serving-CSCF" desc "Function of this server" - -# ------------------ module loading ---------------------------------- -mpath="/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/:/usr/local/lib64/kamailio/modules" -# (we try both the lib64 and the lib directory) - -loadmodule "tm.so" -loadmodule "pv.so" -loadmodule "sl.so" -loadmodule "rr.so" -loadmodule "ims_dialog.so" -loadmodule "textops.so" -loadmodule "textopsx.so" -loadmodule "maxfwd.so" -loadmodule "xlog.so" -loadmodule "sanity.so" -loadmodule "siputils.so" -loadmodule "kex.so" -loadmodule "tmx.so" -loadmodule "pike.so" -#!ifdef DB_URL -loadmodule "presence" -#!endif - -#!ifdef DB_URL -loadmodule "db_mysql" -#!ifdef DB_URL2 -loadmodule "db_cluster" -#!endif -#!endif - -loadmodule "dispatcher" - -loadmodule "enum" -loadmodule "uac" - -# Control interfaces: -loadmodule "ctl" -loadmodule "cfg_rpc" -#!ifdef WITH_XMLRPC -loadmodule "xmlrpc" -#!endif - -loadmodule "cdp.so" -loadmodule "cdp_avp.so" - -loadmodule "ims_usrloc_scscf.so" -loadmodule "ims_registrar_scscf.so" -loadmodule "ims_auth.so" -loadmodule "ims_isc.so" - -#!ifdef WITH_RO -loadmodule "ims_charging.so" -#!endif - -#!ifdef CAPTURE_NODE -loadmodule "siptrace.so" -#!endif - -##!ifdef WITH_DEBUG -loadmodule "debugger.so" -modparam("debugger", "mod_hash_size", 5) -modparam("debugger", "mod_level_mode", 1) -modparam("debugger", "mod_level", "ims_usrloc_scscf=3") -modparam("debugger", "mod_level", "ims_registrar_scscf=3") -modparam("debugger", "mod_level", "ims_auth=3") -modparam("debugger", "mod_level", "ims_isc=3") -modparam("debugger", "mod_level", "ims_dialog=3") -modparam("debugger", "mod_level", "ims_charging=3") -##!endif - -# ----------------- setting module-specific parameters --------------- -#!ifdef DB_URL2 -# ----- db_cluster params ----- -modparam("db_cluster", "connection", DB_URL) -modparam("db_cluster", "connection", DB_URL2) -modparam("db_cluster", "cluster", "cluster1=>con1=2s2s;con2=1s1s") -#!endif - -# ----- presence params ----- -#!ifdef DB_URL -#!ifdef DB_URL2 -modparam("presence", "db_url", "cluster://cluster1") -#!else -modparam("presence", "db_url", DB_URL) -#!endif -#modparam("presence", "fallback2db", 1) -modparam("presence", "db_update_period", 20) -#!endif - -loadmodule "jsonrpcs.so" -# ----- jsonrpcs params ----- -modparam("jsonrpcs", "pretty_format", 1) -/* set the path to RPC fifo control file */ -modparam("jsonrpcs", "fifo_name", "/var/run/kamailio/kamailio_rpc.fifo") -/* set the path to RPC unix socket control file */ -modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio/kamailio_rpc.sock") - -# ----- ctl params ----- -modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl") - -# ----- tm params ----- -# auto-discard branches from previous serial forking leg -modparam("tm", "failure_reply_mode", 3) -# default retransmission timeout: 10sec -modparam("tm", "fr_timer", 10000) -# default invite retransmission timeout after 1xx: 120sec -modparam("tm", "fr_inv_timer", 120000) -# Don't reply automatically with "100 Trying" -modparam("tm", "auto_inv_100", 0) - -# ----- rr params ----- -# add value to ;lr param to cope with most of the UAs -modparam("rr", "enable_full_lr", 1) -# append from tag to the RR -modparam("rr", "append_fromtag", 1) -# add a Username to RR-Header -modparam("rr", "add_username", 1) -# Take User from a custom AVP -modparam("rr", "custom_user_avp", "$avp(RR_CUSTOM_USER_AVP)") - -# -- usrloc params -- -modparam("ims_usrloc_scscf", "enable_debug_file", 0) -modparam("ims_usrloc_scscf", "matching_mode", 0) -modparam("ims_usrloc_scscf", "maxcontact", 1) # set to one as workaround for instable Link -modparam("ims_usrloc_scscf", "maxcontact_3gpp", 1) # set to one as workaround for instable Link -modparam("ims_registrar_scscf", "max_contacts", 5) -modparam("ims_usrloc_scscf", "maxcontact_behaviour", 2) #overwrite -#!ifdef DB_URL -#!ifdef DB_URL2 -modparam("ims_usrloc_scscf", "db_url", "cluster://cluster1") -#!else -modparam("ims_usrloc_scscf", "db_url", DB_URL) -#!endif -modparam("ims_usrloc_scscf", "db_mode", 0) -#!endif -modparam("ims_registrar_scscf", "subscription_default_expires", 654800) -modparam("ims_registrar_scscf", "subscription_min_expires", 3700) -modparam("ims_registrar_scscf", "subscription_max_expires", 605800) - -# -- CDP params -- -modparam("cdp","config_file","/etc/kamailio_scscf/scscf.xml") - -# -- ims_dialog params -- -modparam("ims_dialog", "dlg_flag", FLT_DIALOG) -modparam("ims_dialog", "timeout_avp", "$avp(DLG_TIMEOUT_AVP)") -modparam("ims_dialog", "detect_spirals", 0) -modparam("ims_dialog", "profiles_no_value", "orig ; term") -#!ifdef DB_URL -#!ifdef DB_URL2 -modparam("ims_dialog", "db_url", "cluster://cluster1") -#!else -modparam("ims_dialog", "db_url", DB_URL) -#!endif -modparam("ims_dialog", "db_mode", 0) -#!endif - -#!ifdef WITH_XMLRPC -# ----- xmlrpc params ----- -modparam("xmlrpc", "route", "XMLRPC"); -modparam("xmlrpc", "url_match", "^/RPC") -#!endif - -#!ifdef WITH_DEBUG -# ----- debugger params ----- -modparam("debugger", "cfgtrace", 1) -#!endif - -#!ifdef CAPTURE_NODE -# Destination, where to send the traffic -modparam("siptrace", "duplicate_uri", CAPTURE_NODE) -# Trace all traffic -modparam("siptrace", "trace_on", 1) -modparam("siptrace", "trace_to_database", 0) -modparam("siptrace", "trace_flag", FLT_CAPTURE) -modparam("siptrace", "hep_mode_on", 1) -#!endif - -# -- ims_auth params -- -modparam("ims_auth", "name", URI) -modparam("ims_auth", "registration_default_algorithm", REG_AUTH_DEFAULT_ALG) -#!ifdef CXDX_FORCED_PEER -modparam("ims_auth", "cxdx_forced_peer", CXDX_FORCED_PEER) -#!endif -modparam("ims_auth", "cxdx_dest_realm", NETWORKNAME) -modparam("ims_auth", "av_check_only_impu", 1) - -modparam("ims_auth", "max_nonce_reuse", 20) -modparam("ims_auth", "auth_vector_timeout", 60) -modparam("ims_auth", "auth_data_timeout", 600000) -modparam("ims_auth", "auth_used_vector_timeout", 600000) -modparam("ims_auth", "av_request_at_once", 1) -modparam("ims_auth", "av_request_at_sync", 1) -modparam("ims_auth", "registration_qop", "auth") - -# -- ims_registrar_scscf params -- -#!ifdef WITH_DEBUG -modparam("ims_registrar_scscf", "default_expires", 60) -modparam("ims_registrar_scscf", "min_expires", 60) -modparam("ims_registrar_scscf", "max_expires", 60) -#!else -modparam("ims_registrar_scscf", "default_expires", 604800) -modparam("ims_registrar_scscf", "min_expires", 60) -modparam("ims_registrar_scscf", "max_expires", 604800) -#!endif -modparam("ims_registrar_scscf", "use_path", 1) -modparam("ims_registrar_scscf", "support_wildcardPSI",1) -modparam("ims_registrar_scscf", "user_data_xsd","/etc/kamailio_scscf/CxDataType_Rel7.xsd") -modparam("ims_registrar_scscf", "scscf_name", URI) -modparam("ims_registrar_scscf", "scscf_name", URI) -modparam("ims_registrar_scscf", "cxdx_dest_realm", NETWORKNAME) -modparam("ims_registrar_scscf", "append_branches", 1) -modparam("ims_registrar_scscf", "user_data_always", 0) -modparam("ims_registrar_scscf", "ue_unsubscribe_on_dereg", 1) - -#!ifdef WITH_MULTIDOMAIN -# ----- domain params ----- -#!ifdef DB_URL -#!ifdef DB_URL2 -modparam("domain", "db_url", "cluster://cluster1") -#!else -modparam("domain", "db_url", DB_URL) -#!endif -modparam("domain", "db_mode", 1) -#!endif -# register callback to match myself condition with domains list -modparam("domain", "register_myself", 1) -#!endif - -# ----- ims_isc params ----- -modparam("ims_isc", "my_uri", HOSTNAME) -modparam("ims_isc", "add_p_served_user", 1) - -#!ifdef WITH_RO -# ----- ims_diameter_ro params ----- -#!ifdef DB_URL -#!ifdef DB_URL2 -#modparam("ims_charging", "db_url", "cluster://cluster1") -#!else -#modparam("ims_charging", "db_url", DB_URL) -#!endif -#modparam("ims_charging", "db_mode", 1) -#!endif -modparam("ims_charging", "origin_host", HOSTNAME); -modparam("ims_charging", "origin_realm", NETWORKNAME); -#!ifdef RO_FORCED_PEER -modparam("ims_charging", "ro_forced_peer", RO_FORCED_PEER); -#!endif -modparam("ims_charging", "destination_host", RO_DESTINATION); -modparam("ims_charging", "destination_realm", NETWORKNAME); - -modparam("ims_charging","service_context_id_root", RO_ROOT); -modparam("ims_charging","service_context_id_ext", RO_EXT); -modparam("ims_charging","service_context_id_mnc", RO_MNC); -modparam("ims_charging","service_context_id_mcc", RO_MCC); -modparam("ims_charging","service_context_id_release", RO_RELEASE); - -modparam("ims_charging","interim_update_credits",30); -modparam("ims_charging","timer_buffer",5); -#!endif - -# ----- enum params ----- -modparam("enum", "domain_suffix", "e164.arpa.") - -# ----- sanity params ----- -modparam("sanity", "autodrop", 0) - -# ----------------- Settings for Dispatcher --------------- -modparam("dispatcher", "list_file", "/etc/kamailio_scscf/dispatcher.list") -# Dispatcher: Enable Failover-Support -modparam("dispatcher", "flags", 2) -# Dispatcher: Overwrite Destination address, if required. -modparam("dispatcher", "force_dst", 1) -# AVP's required for Fail-Over-Support: -#modparam("dispatcher", "dst_avp", "$avp(DISPATCHER_DST_AVP)") -#modparam("dispatcher", "grp_avp", "$avp(DISPATCHER_GRP_AVP)") -#modparam("dispatcher", "cnt_avp", "$avp(DISPATCHER_CNT_AVP)") -#modparam("dispatcher", "sock_avp", "$avp(DISPATCHER_SOCK_AVP)") - -#modparam("dispatcher", "xavp_dst", "$avp(DISPATCHER_DST_AVP)") -#modparam("dispatcher", "xavp_dst_mode", 0) -#modparam("dispatcher", "xavp_ctx", "$avp(DISPATCHER_CNT_AVP)") -#modparam("dispatcher", "xavp_ctx_mode", 0) - -# Try to recover disabled destinations every 15 seconds. -modparam("dispatcher", "ds_ping_interval", 15) -# Actively query the gateways: -modparam("dispatcher", "ds_probing_mode", 1) -modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=404;code=480") - -####### Routing Logic ######## -# Main SIP request routing logic -# - processing of any incoming SIP request starts with this route - -route { -##!ifdef WITH_DEBUG - xnotice("SCSCF: $rm $ru ($fu ($si:$sp) to $tu, $ci)\n"); -##!endif - - # per request initial checks - route(REQINIT); - - # Handle Registrations: - if (is_method("REGISTER")) { - route(REGISTER); - exit; - } - - # we need to support subscription to reg event - if (is_method("SUBSCRIBE") && search("^(Event|o)([ \t]*):([ \t]*)reg")) { - route(SUBSCRIBE); - break; - } - - if (is_method("PUBLISH") && search("^(Event|o)([ \t]*):([ \t]*)reg")) { - route(PUBLISH); - break; - } - - # Evaluate Route-Header and set $route_uri - loose_route(); - - if (is_method("CANCEL|ACK")) { - t_relay(); - exit; - } - - #Set DLG flag to track dialogs using dialog2 - if (!is_method("REGISTER|SUBSCRIBE")) - setflag(FLT_DIALOG); - - if (($route_uri =~ "sip:orig@.*") || ($route_uri =~ "sip:orig@"+HOSTNAME_ESC+".*") || isc_from_as("orig")) { - xlog("Orig"); - # we need something like this to assign SCSCF to unregistered user for services - # support for AS origination on behalf of unregistered useri - # can use the registrar is_registered methods - must see if we need to check orig or term? - - # Sanitize the R-URI if domain is present in from of @MSISDN of caller - # What in case of Roaming? - Need to handle it - # if ($ru =~ ".*phone-context.*") { - # if ($ru =~ "tel:.*") { - # # Handle following request-uri - # # tel:0498765432100;phone-context=ims.mnc001.mcc001.3gppnetwork.org - # $ru = $(ru{re.subst,/tel:/sip:/g}); - # } - # # Now in sip: uri format - # if ($ru =~ ".*@.*") { - # $ru = $(ru{re.subst,/@[0-9+-]*;user=phone/@NETWORKNAME;user=phone/g}); - # #$ru = $(ru{re.subst,/;phone-context=[A-Za-z.0-9+-]*@/;phone-context=NETWORKNAME@/g}); - # } else { - # $ru = $ru + "@" + NETWORKNAME + ";user=phone"; - # #$ru = $(ru{re.subst,/;phone-context=[A-Za-z.0-9+-]*@/;phone-context=NETWORKNAME@/g}); - # } - # } - if (!is_method("REGISTER|SUBSCRIBE")) { - # sip:xxx;phone-context=xxxx@xxx format is not desired - if (($ru =~ ".*phone-context.*") && ($ru =~ "sip:.*")) { - $var(old_ruri) = $ru; - $ru = $(ru{re.subst,/sip:/tel:/g}); - $ru = $(ru{re.subst,/;phone-context=[A-Za-z.0-9+-@]*;user=phone//g}); - $ru = $ru + ";phone-context=" + NETWORKNAME; - msg_apply_changes(); - xnotice("SCSCF: Changed R-URI from $var(old_ruri) to $ru\n"); - } - } - - # Originating - route(orig); - break; - } else { - isc_from_as("term"); - if ($retcode == -2) { - # Treat as originating, since it was retargeted: - route(orig); - break; - } - if ((is_in_profile("orig") || has_totag()) && ($route_uri =~ "sip:mo@"+".*")) { - route(orig_subsequent); - break; - } - if ((is_in_profile("term") || has_totag()) && ($route_uri =~ "sip:mt@"+".*")) { - route(term_subsequent); - break; - } - - # Terminating - if (uri == myself || uri =~ "tel:.*") { - if (!term_impu_registered("location")) { - xlog("L_DBG", "We need to do an UNREG server SAR assignemnt"); - assign_server_unreg("UNREG_SAR_REPLY", "location", "term"); - exit; - } else { - sl_send_reply("403","Forbidden - Domain not served"); - exit(); - } - } - route(term); - break; - } -} - -route[UNREG_SAR_REPLY] -{ - xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n"); - switch ($avp(s:saa_return_code)){ - case 1: #success - xlog("L_DBG", "SAR success - will route message\n"); - route(term); - break; - case -1: #failure - xlog("L_ERR", "SAR failure - error response sent from module\n"); - break; - case -2: #error - xlog("L_ERR", "SAR error - error response sent from module\n"); - break; - default: - xlog("L_ERR", "Unknown return code from SAR, value is [$avp(s:saa_return_code)]\n"); - break; - } - exit; -} - - -###################################################################### -# Helper routes (Basic-Checks, NAT-Handling/RTP-Control, XML-RPC) -###################################################################### -# Per SIP request initial checks -route[REQINIT] { - $var(used) = 1 - ($stat(free_size) / $stat(total_size)); - xlog("L_DBG", "Mem: Total $stat(total_size), Free $stat(free_size) [$var(used)% used]\n"); - if ($var(used) > 95) { - send_reply("503", "Server overloaded"); - exit; - } - - # Trace this message -#!ifdef CAPTURE_NODE - sip_trace(); - setflag(FLT_CAPTURE); -#!endif - - if (!mf_process_maxfwd_header("10")) { - sl_send_reply("483","Too Many Hops"); - exit; - } - - if(!sanity_check("1511", "7")) { - xlog("Malformed SIP message from $si:$sp\n"); - exit; - } - - # Check for shutdown mode: - if (!has_totag() && ($sel(cfg_get.system.shutdownmode) > 0)) { - send_reply("503", "Server shutting down"); - exit; - } - - # Reply to OPTIONS: - if (is_method("OPTIONS") && (uri==myself)) { - options_reply(); - exit; - } - - # Ignore Re-Transmits: - if (t_lookup_request()) { - exit; - } - if (is_method("INVITE")) { - send_reply("100", "Trying"); - } - -} - - -###################################################################### -# Publish route -###################################################################### -route[PUBLISH] -{ - if (!t_newtran()) { - #absorb retransmissions - sl_reply("500","Could not create transaction"); - exit; - } - - if (can_publish_reg("location")) { - $var(ret)= publish_reg("location"); - switch ($var(ret)){ - case 1: #success - xlog("L_DBG", "Publish reg successful"); - break; - case -1: #failure - xlog("L_ERR", "Publish reg failure - sending 500 Error now\n"); - t_reply("500","Server Error publishing subscription"); - break; - default: - xlog("L_ERR", "Unknown return code from publish reg event alue is [$var(ret)]\n"); - break; - } - } else { - t_reply("403","Forbidden to PUBLISH"); - exit; - } -} - -###################################################################### -# Subscribe route -###################################################################### -route[SUBSCRIBE] -{ - if (!t_newtran()) { - #absorb retransmissions - sl_reply("500","Could not create transaction"); - exit; - } - - if (!has_totag()) { - xlog("L_DBG", "This is an initial SUBSCRIBE\n"); - if (!term_impu_registered("location")) { - xlog("L_DBG", "We need to do an UNREG server SAR assignment\n"); - assign_server_unreg("SUBSCRIBE_UNREG_SAR_REPLY", "location", "term"); - exit; - } - if (!can_subscribe_to_reg("location")){ - t_reply("403","Forbidden to SUBSCRIBE"); - exit; - } - }else{ - xlog("L_DBG", "This is a subsequent SUBSCRIBE\n"); - } - - $var(ret)= subscribe_to_reg("location"); - switch ($var(ret)){ - case 1: #success - xlog("L_DBG", "Subscribe to reg successful"); - break; - case -1: #failure - xlog("L_ERR", "Subscribe to reg failure - sending 500 Error now\n"); - t_reply("500","Server Error saving subscription"); - break; - case -2: #error - xlog("L_ERR", "Subscribe to reg error sending notify - 200 OK so subscription already sent\n"); - break; - default: - xlog("L_ERR", "Unknown return code from subscribe to reg event alue is [$var(ret)]\n"); - break; - } -} - -route[SUBSCRIBE_UNREG_SAR_REPLY] -{ - - xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n"); - switch ($avp(s:saa_return_code)){ - case 1: #success - xlog("L_DBG", "SAR success - will process subscribe\n"); - if (can_subscribe_to_reg("location")){ - $var(ret)= subscribe_to_reg("location"); - switch ($var(ret)){ - case 1: #success - xlog("L_DBG", "Subscribe to reg successful"); - break; - case -1: #failure - xlog("L_ERR", "Subscribe to reg failure - sending 500 Error now\n"); - t_reply("500","Server Error saving subscription"); - break; - case -2: #error - xlog("L_ERR", "Subscribe to reg error sending notify - 200 OK so subscription already sent\n"); - break; - default: - xlog("L_ERR", "Unknown return code from subscribe to reg event alue is [$var(ret)]\n"); - break; - } - }else{ - t_reply("403","Forbidden to SUBSCRIBE"); - exit; - } - break; - case -1: #failure - xlog("L_ERR", "SAR failure - Sending 403 Forbidden\n"); - t_reply("403","Forbidden to SUBSCRIBE"); - break; - case -2: #error - xlog("L_ERR", "SAR error - Sending 403 Forbidden\n"); - t_reply("403","Forbidden to SUBSCRIBE"); - break; - default: - xlog("L_ERR", "Unknown return code from SAR, value is [$avp(s:saa_return_code)] - sending 403 Forbidden\n"); - t_reply("403","Forbidden to SUBSCRIBE"); - break; - } - exit; -} - -###################################################################### -# XMLRPC routing -###################################################################### -#!ifdef WITH_XMLRPC -route[XMLRPC] { - if ((method=="POST" || method=="GET") -#!ifdef XMLRPC_WHITELIST_1 -&& ((src_ip == XMLRPC_WHITELIST_1) -#!ifdef XMLRPC_WHITELIST_2 - || (src_ip == XMLRPC_WHITELIST_2) -#!endif -#!ifdef XMLRPC_WHITELIST_3 - || (src_ip == XMLRPC_WHITELIST_3) -#!endif -) -#!endif -) { - # close connection only for xmlrpclib user agents (there is a bug in - # xmlrpclib: it waits for EOF before interpreting the response). - if ($hdr(User-Agent) =~ "xmlrpclib") - set_reply_close(); - set_reply_no_connect(); - dispatch_rpc(); - exit; - } - send_reply("403", "Forbidden"); - exit; -} -#!endif - -###################################################################### -# Route for handling Registrations: -###################################################################### -route[REGISTER] { - xnotice("ALGORITHM IS [$aa] and User-Agent is [$ua]\n"); - $var(alg) = $aa; - if ($aa == $null) { - $var(alg) = "MD5"; #force to MD5 for zoiper.... non-ims - } -#!ifdef WITH_AUTH - if (!ims_www_authenticate("$td")) { -#!else - if (($var(alg) == "MD5") && (!ims_www_authenticate("$td"))) { -#!endif - if ($? == -2) { - send_reply("403", "Authentication Failed"); - exit; - } else if ($? == -3) { - send_reply("400", "Bad Request"); - exit; - } else if ($? == -9) { - xlog("L_DBG", "Authentication re-sync requested\n"); - ims_www_resync_auth("REG_RESYNC_REPLY", "$td"); - exit; - } else { - #user has not been authenticated. Lets send a challenge via 401 Unauthorized - xlog("L_DBG","About to challenge! auth_ims\n"); - ims_www_challenge("REG_MAR_REPLY", "$td", "$var(alg)"); - exit; - } - } else { - xlog("L_DBG", "Auth succeeded\n"); - # We need to check if this user is registered or not - if (!impu_registered("location")) { - xlog("L_ERR", "Not REGISTERED\n"); - save("PRE_REG_SAR_REPLY","location"); - exit; - } else { - isc_match_filter_reg("1","location"); - save("REG_SAR_REPLY","location"); - exit; - } - } -} - -route[REG_MAR_REPLY] -{ - #this is async so to know status we have to check the reply avp - xlog("L_DBG","maa_return code is $avp(s:maa_return_code)\n"); - - switch ($avp(s:maa_return_code)){ - case 1: #success - xlog("L_DBG", "MAR success - 401/407 response sent from module\n"); - break; - case -1: #failure - xlog("L_ERR", "MAR failure - error response sent from module\n"); - break; - case -2: #error - xlog("L_ERR", "MAR error - sending error response now\n"); - send_reply("500", "MAR failed"); - break; - default: - xlog("L_ERR", "Unknown return code from MAR, value is [$avp(s:maa_return_code)]\n"); - send_reply("500", "Unknown response code from MAR"); - break; - } - exit; -} - -route[PRE_REG_SAR_REPLY] -{ - xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n"); - #this is async so to know status we have to check the reply avp - xlog("L_DBG","saa_return code (for scscf_save on register) is $avp(s:saa_return_code)\n"); - switch ($avp(s:saa_return_code)){ - case 1: #success - xlog("L_DBG", "SAR success - 200 response sent from module\n"); - isc_match_filter_reg("0","location"); - exit; - case -1: #failure - xlog("L_ERR", "SAR failure - error response sent from module\n"); - break; - case -2: #error - xlog("L_ERR", "SAR error - error response sent from module\n"); - break; - default: - xlog("L_ERR", "Unknown return code from SAR, value is [$avp(s:saa_return_code)]\n"); - break; - } - exit; -} - -route[REG_SAR_REPLY] -{ - xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n"); - #this is async so to know status we have to check the reply avp - xlog("L_DBG","saa_return code (for scscf_save on register) is $avp(s:saa_return_code)\n"); - switch ($avp(s:saa_return_code)){ - case 1: #success - xlog("L_DBG", "SAR success - 200 response sent from module\n"); - exit; - case -1: #failure - xlog("L_ERR", "SAR failure - error response sent from module\n"); - break; - case -2: #error - xlog("L_ERR", "SAR error - error response sent from module\n"); - break; - default: - xlog("L_ERR", "Unknown return code from SAR, value is [$avp(s:saa_return_code)]\n"); - break; - } - exit; -} - -route[REG_RESYNC_REPLY] -{ - ims_www_challenge("REG_MAR_REPLY", "$td"); -} - -###################################################################### -# Apply privacy, if requested -###################################################################### -route[apply_privacy] -{ - if (is_present_hf("Privacy") && ($hdr(Privacy)=="id")) { - remove_hf("P-Asserted-Identity"); - } -} - -###################################################################### -# Originating, Intial Requests -###################################################################### -route[orig] -{ - xlog("L_DBG","Enter orig route\n"); - set_dlg_profile("orig"); - - # we MAYBE need something like this to check if a user is barred - # if (S_originating_barred()){ - # sl_send_reply("403","Forbidden - Originating Public Identity barred"); - # exit; - # } - - if (is_method("INVITE|SUBSCRIBE")) { - $avp(RR_CUSTOM_USER_AVP)="mo"; - record_route(); - } - - # Start new transaction: - t_newtran(); - - # check if dialog saved as fwded to AS - if (isc_match_filter("orig", "location")) { - t_on_failure("isc_orig_failure"); - xlog("Orig - msg was fwded to AS\n"); - exit; - } - - if (!isc_from_as("orig")) { - remove_hf("P-Asserted-Identity"); - append_hf("P-Asserted-Identity: \r\n"); - } - -#!ifdef WITH_RO - # before we allow call - lets check credit - if (is_method("INVITE")) { - xlog("L_DBG","Sending initial CCR Request for call\n"); - $var(cc_ret) = Ro_CCR("CHARGING_CCR_ORIG_REPLY", "orig", 30, "0", "0"); - if ($var(cc_ret) < 0) { - xlog("L_ERR","CCR Request failure\n"); - sl_send_reply("402","Payment required"); - exit; - } - xlog("L_DBG","CCR Request success\n"); - exit; - } -#!endif - route(FINAL_ORIG); -} - -route[FINAL_ORIG] -{ - # Check for PSTN destinations: - if (is_method("INVITE")) { - route(PSTN_handling); - } - - t_on_reply("orig_reply"); - - t_relay(); -} - -route[CHARGING_CCR_ORIG_REPLY] -{ - xlog("L_DBG","cca_return code is $avp(s:cca_return_code)\n"); - - switch ($avp(s:cca_return_code)){ - case 1: #success - xlog("L_DBG", "CCR success - will route message\n"); - route(FINAL_ORIG); - break; - case -1: #failure - xlog("L_ERR", "CCR failure - error response sent from module\n"); - switch ($avp(s:cca_result_code)){ - case 5030: - send_reply("403", "Charging User not found"); - break; - case 5031: - send_reply("403", "Rating failed"); - break; - case 4010: - send_reply("402", "Payment required - Unsufficient funds"); - break; - case 5006: - send_reply("486", "Line limit exceeded"); - break; - default: - send_reply("402","Payment required ($avp(s:cca_result_code))"); - break; - } - case -2: #error - xlog("L_ERR", "CCR error - error response sent from module\n"); - send_reply("500", "Charging Error"); - break; - default: - xlog("L_ERR", "Unknown return code from CCR: [$avp(s:cca_return_code)] \n"); - send_reply("500", "Charging Error"); - break; - } - exit; -} - - -###################################################################### -# Replies to the Initial Requests -###################################################################### -onreply_route[orig_reply] -{ - xlog("L_DBG","Orig reply\n"); - - route(apply_privacy); - break; -} - -###################################################################### -# Originating, subsequent requests -###################################################################### -route[orig_subsequent] -{ - xlog("L_DBG","Orig_Subsequent\n"); - - if (!is_method("ACK")) { - t_on_reply("orig_subsequent_reply"); - } - t_relay(); -} - -###################################################################### -# Replies for originating, subsequent requests -###################################################################### -onreply_route[orig_subsequent_reply] -{ - xlog("L_DBG","Orig_Subsequent_reply\n"); - route(apply_privacy); - break; -} - -###################################################################### -# Failure-Route for Requests to an AS -###################################################################### -failure_route[isc_orig_failure] -{ - xlog("L_DBG","ISC_Orig_failure\n"); - - if (t_check_status("(408)|(5..)")){ - t_on_failure("isc_orig_failure"); - if (isc_match_filter("orig","location")){ - xlog("L_DBG","ISC_Orig_failure - msg was fwded to AS\n"); - exit; - } - - if (isc_from_as("origfail")) { - remove_hf("P-Asserted-Identity"); - append_hf("P-Asserted-Identity: \r\n"); - } - - t_on_reply("orig_reply"); - - t_relay(); - } -} - -###################################################################### -# Terminating requests -###################################################################### -route[term] -{ - xlog("L_DBG","Term\n"); - - set_dlg_profile("term"); - - #we need something like this to check if a user is barred - # if (S_terminating_barred()){ - # sl_send_reply("404","Not Found - Terminating user barred"); - # exit; - # } - - if (is_method("INVITE|SUBSCRIBE")) { - $avp(RR_CUSTOM_USER_AVP)="mt"; - $avp(i:20)="mt"; - record_route(); - } - - # check if dialog saved as fwded to AS - if (isc_match_filter("term","location")){ - t_on_failure("isc_term_failure"); - xlog("L_DBG","Term - msg was fwded to AS\n"); - exit; - } - -#!ifdef WITH_RO_TERM - # before we allow call - lets check credit - if (is_method("INVITE")) { - xlog("L_DBG","Sending initial CCR Request for call\n"); - $var(cc_ret) = Ro_CCR("CHARGING_CCR_TERM_REPLY", "term", 30, "0", "0"); - if ($var(cc_ret) < 0) { - xlog("L_ERR","CCR Request failure\n"); - sl_send_reply("402","Payment required"); - exit; - } - xlog("L_DBG","CCR Request success\n"); - exit; - } -#!endif - route(FINAL_TERM); -} - -route[FINAL_TERM] { - if (lookup("location")) { - if (uri==myself) { - if (!t_newtran()) { - sl_reply_error(); - exit; - } - t_reply("404","Not Found - destination user not found on this S-CSCF"); - exit; - } - } else { - # User not registered? Reply with 404. - if (!t_newtran()) { - sl_reply_error(); - exit; - } - t_reply("404","Not Found - destination user not found on this S-CSCF"); - exit; - } - route(apply_privacy); - - t_relay(); -} - - -route[CHARGING_CCR_TERM_REPLY] -{ - xlog("L_DBG","cca_return code is $avp(s:cca_return_code)\n"); - - switch ($avp(s:cca_return_code)){ - case 1: #success - xlog("L_DBG", "CCR success - will route message\n"); - route(FINAL_TERM); - break; - case -1: #failure - xlog("L_ERR", "CCR failure - error response sent from module\n"); - switch ($avp(s:cca_result_code)){ - case 5030: - send_reply("403", "Charging User not found"); - break; - case 5031: - send_reply("403", "Rating failed"); - break; - case 4010: - send_reply("402", "Payment required - Unsufficient funds"); - break; - case 5006: - send_reply("486", "Line limit exceeded"); - break; - default: - send_reply("402","Payment required ($avp(s:cca_result_code))"); - break; - } - case -2: #error - xlog("L_ERR", "CCR error - error response sent from module\n"); - send_reply("500", "Charging Error"); - break; - default: - xlog("L_ERR", "Unknown return code from CCR: [$avp(s:cca_return_code)] \n"); - send_reply("500", "Charging Error"); - break; - } - exit; -} - - -###################################################################### -# Failure Route for Terminating requests -###################################################################### -failure_route[isc_term_failure] -{ - xlog("L_DBG","ISC_term_failure\n"); - - if (t_check_status("(408)|(5..)")){ - t_on_failure("isc_term_failure"); - if (isc_match_filter("term","location")){ - xlog("L_DBG","Term - msg was fwded to AS\n"); - exit; - } - - if (lookup("location")) { - if (uri==myself) { - t_reply("404","Not Found - destination user not found on this S-CSCF"); - exit; - } - } else { - t_reply("404","Not Found - destination user not found on this S-CSCF"); - exit; - } - t_relay(); - } -} - -###################################################################### -# Terminating, subsequent requests -###################################################################### -route[term_subsequent] -{ - xlog("L_DBG","term_subsequent\n"); - route(apply_privacy); - t_relay(); -} - -###################################################################### -# Check for PSTN destinations: -###################################################################### -route[PSTN_handling] -{ - # First, we translate "tel:"-URI's to SIP-URI's: - # $ru: tel:+(34)-999-888-777 - # $fu: sip:test@foo.com - # becomes $ru: sip:+34999888777@foo.com;user=phone - if (tel2sip2("$ru", "$fd", "$ru") < 0) - xlog("L_WARN","Failed to convert $ru to a sip:-URI - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n"); - - if ($rU =~ "\+[0-9]+") { - # Now let's check, if the number can be found in ENUM: - if(!enum_query()) { - # ENUM failed, send it to the PSTN-Gateway: - route(PSTN); - break; - } - } -} - -###################################################################### -# Send calls to the PSTN-Gateways: -###################################################################### -route[PSTN] -{ - $var(has_trf) = 0; - if (is_present_hf("Feature-Caps")) { - xlog("Feature-Caps: $hdr(Feature-Caps) => $(hdr(Feature-Caps){param.value,+g.3gpp.trf}{nameaddr.uri}{uri.host})\n"); - if ($(hdr(Feature-Caps){param.value,+g.3gpp.trf}) != $null) { - $rd = $(hdr(Feature-Caps){param.value,+g.3gpp.trf}{nameaddr.uri}{uri.host}); - if (!strempty($(ou{uri.params}))) { - $ru = $ru+";"+$(ou{uri.params}); - } - - t_on_failure("TRF_failure"); - if (t_relay_to("0x02")) { - $var(has_trf) = 1; - } else { - xlog("Relay to $du failed.\n"); - $du = $null; - } - } - } - - if ($var(has_trf) == 0) { - if (!ds_select_domain("1", "4")) { - xlog("L_WARN","No PSTN-Gateways available - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n"); - send_reply("503", "Service not available"); - exit; - } - if (!strempty($(ou{uri.params}))) { - $ru = $ru+";"+$(ou{uri.params}); - } - t_relay(); - } - # Relay the request: - t_on_failure("PSTN_failure"); - - exit; -} - -###################################################################### -# manage failure routing cases, perform failover -###################################################################### -failure_route[TRF_failure] { - xlog("TRF_failure\n"); - # Choose another gateway, in case we - # - get a local generated "408" - # - receive a 5xx or 6xx reply from the proxy. - if (t_branch_timeout() || t_check_status("[5-6]..")) { - $du = $null; - if (!ds_select_domain("1", "4")) { - xlog("L_WARN","No PSTN-Gateways available - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n"); - send_reply("503", "Service not available"); - exit; - } - if (!strempty($(ou{uri.params}))) { - $ru = $ru+";"+$(ou{uri.params}); - } - # Relay the request: - t_on_failure("PSTN_failure"); - - t_relay(); - exit; - } -} - -###################################################################### -# manage failure routing cases, perform failover -###################################################################### -failure_route[PSTN_failure] { - # Choose another gateway, in case we - # - get a local generated "408" - # - receive a 5xx or 6xx reply from the proxy. - if (t_branch_timeout() || t_check_status("[5-6]..")) { - if (ds_next_domain()) { - if (!strempty($(ou{uri.params}))) { - $ru = $ru+";"+$(ou{uri.params}); - } - # Do Failover in case problems: - t_on_failure("PSTN_failure"); - t_relay(); - } else { - # Add a header, to indicate the phone should try again in 30 seconds. - append_hf("Retry-After: 30\r\n"); - send_reply("503", "Service not available"); - } - exit; - } -} diff --git a/scscf/scscf/scscf.cfg b/scscf/scscf/scscf.cfg deleted file mode 100644 index 3fae63b..0000000 --- a/scscf/scscf/scscf.cfg +++ /dev/null @@ -1,84 +0,0 @@ -# SIP / UDP -listen=udp:SCSCF_IP:6060 -# SIP / TCP -listen=tcp:SCSCF_IP:6060 -# SIP / TCP/TLS -#listen=tls:SCSCF_IP:6061 - -#!define NETWORKNAME "IMS_DOMAIN" -#!define NETWORKNAME_ESC "IMS_SLASH_DOMAIN" -#!define HOSTNAME "scscf.IMS_DOMAIN" -#!define HOSTNAME_ESC "scscf\.IMS_SLASH_DOMAIN" -#!define URI "sip:scscf.IMS_DOMAIN:6060" - -#!subst "/NETWORKNAME/IMS_DOMAIN/" - -alias=scscf.IMS_DOMAIN - -# ENUM-Server to query: -#!define ENUM_SUFFIX "IMS_DOMAIN." - -# SIP-Address of capturing node, if not set, capturing is disabled. -##!define CAPTURE_NODE "sip:127.0.0.1:9060" - -# Connection URL for the database: -# For use with a single database: -#!define DB_URL "mysql://scscf:heslo@MYSQL_IP/scscf" - -# For use with DB_Cluster: con1 (primary), con2 (backup) -##!define DB_URL "con1=>mysql://scscf:heslo@MYSQL_IP/scscf" -##!define DB_URL2 "con2=>mysql://scscf:heslo@MYSQL_IP/scscf" - -# Select Authorization Algorhithm: -##!define REG_AUTH_DEFAULT_ALG "AKAv1-MD5" -##!define REG_AUTH_DEFAULT_ALG "AKAv2-MD5" -##!define REG_AUTH_DEFAULT_ALG "MD5" -##!define REG_AUTH_DEFAULT_ALG "CableLabs-Digest" -##!define REG_AUTH_DEFAULT_ALG "3GPP-Digest" -##!define REG_AUTH_DEFAULT_ALG "TISPAN-HTTP_DIGEST_MD5" -# Let the HSS decide -#!define REG_AUTH_DEFAULT_ALG "HSS-Selected" - -# Number of TCP Processes -#!define TCP_PROCESSES 3 - -##!define RO_FORCED_PEER "32260@3gpp.org" -#!define RO_DESTINATION "hssocs.voiceblue.com" -#!define RO_ROOT "32260@3gpp.org" -#!define RO_EXT "ext" -#!define RO_MNC "02" -#!define RO_MCC "001" -#(see https://en.wikipedia.org/wiki/Mobile_country_code_(MCC)) -#!define RO_RELEASE "8" -# See http://tools.ietf.org/html/rfc4006#section-4.1.2 for the definition of the Service-Context - -##!define XMLRPC_WHITELIST_1 "127.0.0.1" -##!define XMLRPC_WHITELIST_2 "127.0.0.1" -##!define XMLRPC_WHITELIST_3 "127.0.0.1" - -# Several features can be enabled using '#!define WITH_FEATURE' directives: -# -# *** To run in debug mode: -# - define WITH_DEBUG -# -# *** To enable TCP support execute: -# - define WITH_TCP -# -# *** To enable XMLRPC support execute: -# - define WITH_XMLRPC -# - this will automagically enable TCP -# -# *** To enable the Ro-Interface: -# - Configure Ro-Diameter-Interface in scscf.xml -# - define WITH_RO -# -# *** To enable a Homer SIP-Capter-Node: -# - define CAPTURE_NODE with a proper address -# -# Enabled Features for this host: -##!define WITH_DEBUG -#!define WITH_TCP -##!define WITH_XMLRPC -##!define WITH_RO -##!define WITH_RO_TERM -#!define WITH_AUTH diff --git a/scscf/scscf/scscf.xml b/scscf/scscf/scscf.xml deleted file mode 100644 index d282882..0000000 --- a/scscf/scscf/scscf.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/scscf/scscf/scscf_init.sh b/scscf/scscf/scscf_init.sh deleted file mode 100755 index 2fd4a23..0000000 --- a/scscf/scscf/scscf_init.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -# BSD 2-Clause License - -# Copyright (c) 2020, Supreeth Herle -# All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: - -# 1. Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. - -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -[ ${#MNC} == 3 ] && IMS_DOMAIN="ims.mnc${MNC}.mcc${MCC}.3gppnetwork.org" || IMS_DOMAIN="ims.mnc0${MNC}.mcc${MCC}.3gppnetwork.org" - -mkdir -p /etc/kamailio_scscf -cp /mnt/scscf/scscf.cfg /etc/kamailio_scscf -cp /mnt/scscf/scscf.xml /etc/kamailio_scscf -cp /mnt/scscf/kamailio_scscf.cfg /etc/kamailio_scscf -cp /mnt/scscf/CxDataType_Rel6.xsd /etc/kamailio_scscf -cp /mnt/scscf/CxDataType_Rel7.xsd /etc/kamailio_scscf -cp /mnt/scscf/CxDataType_Rel8.xsd /etc/kamailio_scscf -cp /mnt/scscf/dispatcher.list /etc/kamailio_scscf - -while ! mysqladmin ping -h ${MYSQL_IP} --silent; do - sleep 5; -done - -# Sleep until permissions are set -sleep 10; - -# Create SCSCF database, populate tables and grant privileges -if [[ -z "`mysql -u root -h ${MYSQL_IP} -qfsBe "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='scscf'" 2>&1`" ]]; -then - mysql -u root -h ${MYSQL_IP} -e "create database scscf;" - mysql -u root -h ${MYSQL_IP} scscf < /usr/local/src/kamailio/utils/kamctl/mysql/standard-create.sql - mysql -u root -h ${MYSQL_IP} scscf < /usr/local/src/kamailio/utils/kamctl/mysql/presence-create.sql - mysql -u root -h ${MYSQL_IP} scscf < /usr/local/src/kamailio/utils/kamctl/mysql/ims_usrloc_scscf-create.sql - mysql -u root -h ${MYSQL_IP} scscf < /usr/local/src/kamailio/utils/kamctl/mysql/ims_dialog-create.sql - mysql -u root -h ${MYSQL_IP} scscf < /usr/local/src/kamailio/utils/kamctl/mysql/ims_charging-create.sql - SCSCF_USER_EXISTS=`mysql -u root -h ${MYSQL_IP} -s -N -e "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE User = 'scscf' AND Host = '%')"` - if [[ "$SCSCF_USER_EXISTS" == 0 ]] - then - mysql -u root -h ${MYSQL_IP} -e "CREATE USER 'scscf'@'%' IDENTIFIED WITH mysql_native_password BY 'heslo'"; - mysql -u root -h ${MYSQL_IP} -e "CREATE USER 'scscf'@'$SCSCF_IP' IDENTIFIED WITH mysql_native_password BY 'heslo'"; - mysql -u root -h ${MYSQL_IP} -e "GRANT ALL ON scscf.* TO 'scscf'@'%'"; - mysql -u root -h ${MYSQL_IP} -e "GRANT ALL ON scscf.* TO 'scscf'@'$SCSCF_IP'"; - mysql -u root -h ${MYSQL_IP} -e "FLUSH PRIVILEGES;" - fi -fi - -export IMS_SLASH_DOMAIN=`echo $IMS_DOMAIN | sed 's/\./\\\./g'` - -sed -i 's|SCSCF_IP|'$SCSCF_IP'|g' /etc/kamailio_scscf/scscf.cfg -sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_scscf/scscf.cfg -sed -i 's|IMS_SLASH_DOMAIN|'$IMS_SLASH_DOMAIN'|g' /etc/kamailio_scscf/scscf.cfg -sed -i 's|MYSQL_IP|'$MYSQL_IP'|g' /etc/kamailio_scscf/scscf.cfg - -sed -i 's|SCSCF_IP|'$SCSCF_IP'|g' /etc/kamailio_scscf/scscf.xml -sed -i 's|IMS_DOMAIN|'$IMS_DOMAIN'|g' /etc/kamailio_scscf/scscf.xml -sed -i 's|PYHSS_BIND_PORT|'$PYHSS_BIND_PORT'|g' /etc/kamailio_scscf/scscf.xml -sed -i 's|SCSCF_BIND_PORT|'$SCSCF_BIND_PORT'|g' /etc/kamailio_scscf/scscf.xml - -# Sync docker time -#ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone From cd2c73150f8c4939520d236ed5875e3e04d930a8 Mon Sep 17 00:00:00 2001 From: Abdulkarim Barbour <63456208+NUCLEAR-WAR@users.noreply.github.com> Date: Wed, 1 Jan 2025 03:59:18 +0100 Subject: [PATCH 06/14] change ringtone indication to DE change ringtone indication to DE --- ibcf/config/indications.conf | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/ibcf/config/indications.conf b/ibcf/config/indications.conf index ccf249d..fb25531 100644 --- a/ibcf/config/indications.conf +++ b/ibcf/config/indications.conf @@ -1,18 +1,21 @@ [general] country = us ; We are in Waldo, Al, USA so the US is our default. -[us] -description = United States / North America -ringcadence = 2000,4000 -dial = 350+440 -busy = 480+620/500,0/500 -ring = 440+480/2000,0/4000 -congestion = 480+620/250,0/250 -callwaiting = 440/300,0/10000 -dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440 -record = 1400/500,0/15000 -info = !950/330,!1400/330,!1800/330,0 -stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440 +[de] +description = Germany +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf +ringcadence = 1000,4000 +dial = 425 +busy = 425/480,0/480 +ring = 425/1000,0/4000 +congestion = 425/240,0/240 +callwaiting = !425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,0 +; DIALRECALL - not specified +dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425 +; RECORDTONE - not specified +record = 1400/80,0/15000 +info = 950/330,1400/330,1800/330,0/1000 +stutter = 425+400 ; Additional country configurations can be found in the Asterisk source ; at /configs/samples/indications.conf.sample From b09514465611d08cea1d52e4277f26df79a6ed84 Mon Sep 17 00:00:00 2001 From: Abdulkarim Barbour <63456208+NUCLEAR-WAR@users.noreply.github.com> Date: Wed, 1 Jan 2025 04:06:21 +0100 Subject: [PATCH 07/14] add more info --- ibcf/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibcf/README.md b/ibcf/README.md index f0ab21b..d1a23c3 100644 --- a/ibcf/README.md +++ b/ibcf/README.md @@ -1,5 +1,5 @@ This is a basic kind of IBCF based on Asterisk to handle calls from and to Docker_open5gs, I tried my best to do all the configs, but it still requires your adjustments. -Please read the Comments carefully before starting the container, specially in : pjsip.conf, extenteions.conf and voiemail.conf, those files must be configured otherwise the IBCF will not work properly!! +Please read the Comments carefully before starting the container, specially in : pjsip.conf, acl.conf, extenteions.conf and voiemail.conf, those files must be configured otherwise the IBCF will not work properly!! have fun Testing! From c58d1786215d5aaf89aec467aede04b709958ec1 Mon Sep 17 00:00:00 2001 From: local_dev_user Date: Wed, 1 Jan 2025 23:40:14 +0000 Subject: [PATCH 08/14] fixing file-ending limiting ENUM to only +49 --- dns/e164.arpa | 5 +++-- dns/ims_zone | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dns/e164.arpa b/dns/e164.arpa index 192d01a..3339a50 100644 --- a/dns/e164.arpa +++ b/dns/e164.arpa @@ -10,5 +10,6 @@ $TTL 1h @ IN A DNS_IP ; Wildcard to match any tel:+xxxx and change to sip:xxxx@IMS_DOMAIN -* IN NAPTR 10 100 "u" "E2U+sip" "!(^.*$)!sip:\\1@IMS_DOMAIN!" . -* IN NAPTR 20 100 "u" "E2U+sip" "!(^.*$)!sip:+\\1@IMS_DOMAIN!" . +*.9.4 IN NAPTR 20 100 "u" "E2U+sip" "!(^.*$)!sip:\\1@ibcf.IMS_DOMAIN!" . +; add more country codes to route over IBCF : +; * IN NAPTR 20 100 "u" "E2U+sip" "!(^.*$)!sip:\\1@ibcf.IMS_DOMAIN!" . diff --git a/dns/ims_zone b/dns/ims_zone index 1e02e32..a1697e2 100644 --- a/dns/ims_zone +++ b/dns/ims_zone @@ -27,3 +27,11 @@ hss 1D IN A PYHSS_IP smsc 1D IN A SMSC_IP _sip._udp.smsc 1D SRV 0 0 7090 smsc _sip._tcp.smsc 1D SRV 0 0 7090 smsc + +ibcf 1D IN A IBCF_IP +_sip._udp.ibcf 1D SRV 0 0 5090 ibcf +_sip._tcp.ibcf 1D SRV 0 0 5090 ibcf + +voicemail 1D IN A IBCF_IP +_sip._udp.voicemail 1D SRV 0 0 5090 voicemail +_sip._tcp.voicemail 1D SRV 0 0 5090 voicemail From 1caa3a042f1deef7a96c7cd12aa2cddb3b35b676 Mon Sep 17 00:00:00 2001 From: local_dev_user Date: Wed, 1 Jan 2025 23:48:10 +0000 Subject: [PATCH 09/14] Limiting ENUM to only +49 --- dns/e164.arpa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/e164.arpa b/dns/e164.arpa index 3339a50..12a8e57 100644 --- a/dns/e164.arpa +++ b/dns/e164.arpa @@ -11,5 +11,5 @@ $TTL 1h ; Wildcard to match any tel:+xxxx and change to sip:xxxx@IMS_DOMAIN *.9.4 IN NAPTR 20 100 "u" "E2U+sip" "!(^.*$)!sip:\\1@ibcf.IMS_DOMAIN!" . -; add more country codes to route over IBCF : +; add more country codes to route over IBCF using the same format as above, you may need also to adjust teh dialplan in Asterisk: ; * IN NAPTR 20 100 "u" "E2U+sip" "!(^.*$)!sip:\\1@ibcf.IMS_DOMAIN!" . From 1f3482a16ab9d648438f561f7f6a55437daa1ac1 Mon Sep 17 00:00:00 2001 From: Abdulkarim Barbour <63456208+NUCLEAR-WAR@users.noreply.github.com> Date: Thu, 2 Jan 2025 00:53:54 +0100 Subject: [PATCH 10/14] change default to "de" for ringtones --- ibcf/config/indications.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibcf/config/indications.conf b/ibcf/config/indications.conf index fb25531..6953c3e 100644 --- a/ibcf/config/indications.conf +++ b/ibcf/config/indications.conf @@ -1,5 +1,5 @@ [general] -country = us ; We are in Waldo, Al, USA so the US is our default. +country = de [de] description = Germany From 3a892cd7e38a9f156e89f3d4812dc73bf11b86ff Mon Sep 17 00:00:00 2001 From: Abdulkarim Barbour <63456208+NUCLEAR-WAR@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:42:22 +0100 Subject: [PATCH 11/14] enabling queries for route to IMS_DOMAIN enabling queries for route to IMS_DOMAIN Add some comments for more explanation --- dns/e164.arpa | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dns/e164.arpa b/dns/e164.arpa index 12a8e57..67f7b05 100644 --- a/dns/e164.arpa +++ b/dns/e164.arpa @@ -10,6 +10,8 @@ $TTL 1h @ IN A DNS_IP ; Wildcard to match any tel:+xxxx and change to sip:xxxx@IMS_DOMAIN +* IN NAPTR 10 100 "u" "E2U+sip" "!(^.*$)!sip:\\1@IMS_DOMAIN!" . +; Record to route calls starting with DE +49 to IBCF : *.9.4 IN NAPTR 20 100 "u" "E2U+sip" "!(^.*$)!sip:\\1@ibcf.IMS_DOMAIN!" . -; add more country codes to route over IBCF using the same format as above, you may need also to adjust teh dialplan in Asterisk: -; * IN NAPTR 20 100 "u" "E2U+sip" "!(^.*$)!sip:\\1@ibcf.IMS_DOMAIN!" . +; add more country codes to route over IBCF using the same format as above, you may need also to adjust the dialplan in Asterisk, e.g. for UK +44: +; *.4.4 IN NAPTR 20 100 "u" "E2U+sip" "!(^.*$)!sip:\\1@ibcf.IMS_DOMAIN!" . From a0a0e104d1a247c3370c2de703d27fb7e71d6ad7 Mon Sep 17 00:00:00 2001 From: Abdulkarim Barbour <63456208+NUCLEAR-WAR@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:51:03 +0100 Subject: [PATCH 12/14] formatting and aligning --- pcscf/route/mo.cfg | 102 ++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 56 deletions(-) diff --git a/pcscf/route/mo.cfg b/pcscf/route/mo.cfg index 18421f0..157767b 100644 --- a/pcscf/route/mo.cfg +++ b/pcscf/route/mo.cfg @@ -77,7 +77,7 @@ route[MO] #!ifdef WITH_N5 if(is_method("INVITE")) { - route(N5_INIT_REQ); + route(N5_INIT_REQ); } #!endif @@ -104,7 +104,6 @@ route[MO] } #!ifdef WITH_N5 - # Route Logic for N5 Requests route[N5_INIT_REQ] { @@ -310,7 +309,6 @@ route[N5_INIT_REQ] { } #!endif - ###################################################################### # Replies to Originating Initial Requests ###################################################################### @@ -328,22 +326,19 @@ onreply_route[MO_reply] { #!ifdef WITH_N5 # N5 PATCH Request for updating AppSession context - if (t_check_status("180|183|200") && has_body("application/sdp")) { - xlog("L_INFO", "Received early answer in 18x. Patching N5 session in PCF\n"); - if (t_is_retr_async_reply()) { - xlog("L_INFO", "Dropping retransmitted reply which is still currently suspended\n"); - drop(); - } - route(N5_PATCH_REQ); + if(t_check_status("180|183|200") && has_body("application/sdp")){ + xlog("L_INFO", "Received early answer in 18x. Patching N5 session in PCF\n"); + if(t_is_retr_async_reply()) { + xlog("L_INFO", "Dropping retransmitted reply which is still currently suspended\n"); + drop(); + } + route(N5_PATCH_REQ); + } +# Terminating N5 AppSession after CANCEL/ERROR + if(is_method("CANCEL") || status=~"[45][0-9][0-9]"){ + xlog("L_ALERT", "Terminating AppSession For Call fom User $fU due to call END or Call Faild\n"); + route(N5_MOC_TERM); } - - -## Terminating N5 AppSession after CANCEL/ERROR## - if(is_method("CANCEL") || status=~"[45][0-9][0-9]"){ - xlog("L_ALERT", "Terminating AppSession For Call fom User $fU due to call END or Call Faild\n"); - route(N5_MOC_TERM); - } - #!endif #!ifdef WITH_IPSEC @@ -401,16 +396,15 @@ route[MO_indialog] { #!ifdef WITH_N5 # N5 PATCH Request for updating AppSession context - if (is_method("INVITE")) { - xlog("L_INFO"," InDialog SDP Answer N5 Request for reINVITE\n"); - route(N5_PATCH_REQ); + if (is_method("INVITE")){ + xlog("L_INFO"," InDialog SDP Answer N5 Request for reINVITE\n"); + route(N5_PATCH_REQ); } # Terminating N5 AppSession after BYE - if(is_method("BYE|CANCEL")) - { - route(N5_MOC_TERM); - } + if(is_method("BYE|CANCEL")){ + route(N5_MOC_TERM); + } #!endif xnotice("PCSCF MO_indialog: \n Destination URI: $du\n Request URI: $ru\n"); @@ -633,38 +627,34 @@ route[N5_PATCH_REQ] { } } #!endif - #!ifdef WITH_N5 -route[N5_MOC_TERM] { - - # Retrieving and paying attention to whom ended the call - $var(user_id_call_rel) = $fU; # User Part of the from Header to get the USER - $var(user_appsess_call_rel) = $sht(user_data=>$var(user_id_call_rel)); - if $var(user_appsess_call_rel) == 0 { - xlog("L_INFO", "we dont have AppSessionID to terminate, doing alternative Method\n"); - - # Retrieving and paying attention to whom ended the call - $var(user_id_call_rel) = $tU; # User Part of the from Header to get the USER - $var(user_appsess_call_rel) = $sht(user_data=>$var(user_id_call_rel)); - xlog("L_INFO", "Alt-Method : Terminating Stored AppSession for user $var(user_id_call_rel): $var(user_appsess_call_rel)\n"); - } else { - xlog("L_INFO", "We have AppSessionID, doing normal Method\n"); - xlog("L_INFO", "Normal Method : Stored MOC AppSession for user $var(user_id_call_rel): $var(user_appsess_call_rel)\n"); - } +route[N5_MOC_TERM]{ + # Retrieving and paying attention to whom ended the call + $var(user_id_call_rel) = $fU; # User Part of the from Header to get the USER + $var(user_appsess_call_rel) = $sht(user_data=>$var(user_id_call_rel)); + if $var(user_appsess_call_rel) == 0 { + xlog("L_INFO", "we dont have AppSessionID to terminate, doing alternative Method\n"); - $var(headers) = "X-SIP-Status: Call-Termination\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n"; - $var(headers) = $var(headers) + "accept: application/json\r\n"; - $var(headers) = $var(headers) + "accept: application/problem+json\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n"; - $var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now); - - http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_call_rel)/delete", "$var(json_request)", "$var(headers)", "$var(result)" ); - xlog("L_INFO", "Termination resuls: $var(result)\n"); - xlog("L_INFO", "response header: $curlerror(error)\n"); - xlog("L_INFO", "response header: $var(response_code)\n"); - xlog("L_INFO", "response header: $httprhdr(location)\n"); - xlog("L_INFO", "response header: $rc\n"); + # Retrieving and paying attention to whom ended the call + $var(user_id_call_rel) = $tU; # User Part of the from Header to get the USER + $var(user_appsess_call_rel) = $sht(user_data=>$var(user_id_call_rel)); + xlog("L_INFO", "Alt-Method : Terminating Stored AppSession for user $var(user_id_call_rel): $var(user_appsess_call_rel)\n"); + } else { + xlog("L_INFO", "We have AppSessionID, doing normal Method\n"); + xlog("L_INFO", "Normal Method : Stored MOC AppSession for user $var(user_id_call_rel): $var(user_appsess_call_rel)\n"); + } + $var(headers) = "X-SIP-Status: Call-Termination\r\n"; + $var(headers) = $var(headers) + "3gpp-sbi-discovery-target-nf-type: NRF\r\n"; + $var(headers) = $var(headers) + "accept: application/json\r\n"; + $var(headers) = $var(headers) + "accept: application/problem+json\r\n"; + $var(headers) = $var(headers) + "3gpp-sbi-max-rsp-time: 10000\r\n"; + $var(headers) = $var(headers) + "3gpp-sbi-discovery-service-names: npcf-policyauthorization\r\n"; + $var(headers) = $var(headers) + "3gpp-sbi-sender-timestamp: " + $var(time_now); + http_client_request_v2pk("POST", "http://172.22.0.27:7777/npcf-policyauthorization/v1/app-sessions/$var(user_appsess_call_rel)/delete", "$var(json_request)", "$var(headers)", "$var(result)" ); + xlog("L_INFO", "Termination resuls: $var(result)\n"); + xlog("L_INFO", "response header: $curlerror(error)\n"); + xlog("L_INFO", "response header: $var(response_code)\n"); + xlog("L_INFO", "response header: $httprhdr(location)\n"); + xlog("L_INFO", "response header: $rc\n"); } #!endif From 0dc4028172065c32c538c0aa89cc077d69f389b2 Mon Sep 17 00:00:00 2001 From: Abdulkarim Barbour <63456208+NUCLEAR-WAR@users.noreply.github.com> Date: Fri, 3 Jan 2025 20:16:59 +0100 Subject: [PATCH 13/14] updating ENUM_SUFFIX to match standard "e164.arpa." value --- icscf/icscf.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icscf/icscf.cfg b/icscf/icscf.cfg index de68194..aba876b 100644 --- a/icscf/icscf.cfg +++ b/icscf/icscf.cfg @@ -12,7 +12,7 @@ alias=IMS_DOMAIN #!subst "/NETWORKNAME/IMS_DOMAIN/" -#!define ENUM_SUFFIX "IMS_DOMAIN." +#!define ENUM_SUFFIX "e164.arpa." # SIP-Address of capturing node, if not set, capturing is disabled. ##!define CAPTURE_NODE "sip:127.0.0.1:9060" From 35cb57c258d84b9862a319921c27aca231a55921 Mon Sep 17 00:00:00 2001 From: Abdulkarim Barbour <63456208+NUCLEAR-WAR@users.noreply.github.com> Date: Fri, 3 Jan 2025 20:18:00 +0100 Subject: [PATCH 14/14] restoring enum domain_suffix to ENUM_SUFFIX and update the variable in scscf.cfg file --- scscf/kamailio_scscf.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scscf/kamailio_scscf.cfg b/scscf/kamailio_scscf.cfg index ba46272..8c756ac 100644 --- a/scscf/kamailio_scscf.cfg +++ b/scscf/kamailio_scscf.cfg @@ -360,7 +360,7 @@ modparam("ims_charging","timer_buffer",5); #!endif # ----- enum params ----- -modparam("enum", "domain_suffix", "e164.arpa.") +modparam("enum", "domain_suffix", ENUM_SUFFIX) # ----- sanity params ----- modparam("sanity", "autodrop", 0)