From 1815f0fdd7e3e93cf2df1c09ba51ff3a8e5e9bf4 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 26 Nov 2021 08:09:09 +0800 Subject: [PATCH] separate peers and self exten --- extensions.conf | 22 ++++++++++++++++++---- pjsip.conf | 19 ++++++++++--------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/extensions.conf b/extensions.conf index bb88549..82def42 100644 --- a/extensions.conf +++ b/extensions.conf @@ -58,11 +58,15 @@ exten => 3,100,NoOp() same => n,Return() exten => 4,100,NoOp() - same => n,Read(TMPNOM,z-external,1,,1,0.1) + same => n,Read(TMPNOM,0005-unreeeal_superhero_3,1,,1,0.1) same => n,Return() exten => 5,100,NoOp() - same => n,Read(TMPNOM,z-macroform-cold_day,1,,1,0.1) + same => n,Read(TMPNOM,0006-external,1,,1,0.1) + same => n,Return() + +exten => 6,100,NoOp() + same => n,Read(TMPNOM,0009-macroform-cold_day,1,,1,0.1) same => n,Return() exten => _X,100,NoOp() @@ -83,13 +87,13 @@ exten => 0001,5,Dial(PJSIP/REDACTED,300,m) exten => 0002,5,Dial(PJSIP/REDACTED,300,m) exten => 0003,5,Dial(PJSIP/REDACTED,300,m) exten => 0004,5,Dial(PJSIP/REDACTED,300,m) -exten => 0005,5,Dial(PJSIP/REDACTED,300,m) +exten => 0005/_42403618X!,5,Dial(PJSIP/REDACTED,300,m) exten => 0000,5,Goto(extmymenu,${EXTEN},200) exten => 0 ,5,Goto(extmymenu,${EXTEN},200) exten => 3618,5,Goto(extmymenu,${EXTEN},210) exten => 4242,5,Goto(extdn42whois,${EXTEN},200) exten => _X! ,5,Playback(im-sorry&check-number-dial-again) -exten => _X! ,6,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?chanunavail,1:) + same => n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?chanunavail,1:) [extpeers] exten => _42403618.,5,Answer() @@ -115,3 +119,13 @@ exten => _42400119.,5,NoOp() exten => _4240XXXX.,1,Goto(extpeers,${EXTEN},5) exten => _0XXXX. ,1,Goto(extpeers,424${EXTEN},5) exten => _X! ,1,Goto(extpeers,42403618${EXTEN},5) + +[jerry-peers] +exten => invalidcaller,100,Playback(silence/1&sorry-youre-having-problems) + same => n,Hangup() + +exten => _X!/_42403618X!,1,Goto(invalidcaller,100) +exten => _X! ,1,NoOp() +exten => _4240XXXX.,2,Goto(extpeers,${EXTEN},5) +exten => _0XXXX. ,2,Goto(extpeers,424${EXTEN},5) +exten => _X! ,2,Goto(extpeers,42403618${EXTEN},5) diff --git a/pjsip.conf b/pjsip.conf index 7c5693f..3307352 100644 --- a/pjsip.conf +++ b/pjsip.conf @@ -18,12 +18,16 @@ bind=[::]:5060 type=endpoint context=jerry ;message_context=jerry-msg -allow=!all,ulaw,opus48,opus,speex,alaw +allow=!all,opus48,opus,ulaw,speex,alaw ;direct_media=no rtp_symmetric=no force_rport=yes rewrite_contact=yes +[peers-endpoint-template](!,endpoint-template) +context=jerry-peers +allow=!all,ulaw,opus48,opus,speex,alaw + [auth-template](!) type=auth @@ -37,7 +41,6 @@ remove_existing=yes [REDACTED](endpoint-template) auth = REDACTED aors = REDACTED -allow=!all,opus48,opus,ulaw,speex,alaw callerid=Jerry <424036180001> [REDACTED](auth-template) auth_type=userpass @@ -48,7 +51,6 @@ password=REDACTED [REDACTED](endpoint-template) auth = REDACTED aors = REDACTED -allow=!all,opus48,opus,ulaw,speex,alaw callerid=Jerry <424036180002> [REDACTED](auth-template) auth_type=userpass @@ -81,7 +83,6 @@ password=REDACTED [REDACTED](endpoint-template) auth = REDACTED aors = REDACTED -allow=!all,opus48,opus,ulaw,speex,alaw callerid=Jerry <424036180005> [REDACTED](auth-template) auth_type=userpass @@ -93,7 +94,7 @@ password=REDACTED ;=============PEERS============== -[nia](endpoint-template) +[nia](peers-endpoint-template) aors = nia identify_by=ip [nia](aor-template) @@ -103,7 +104,7 @@ type=identify endpoint=nia match=172.20.168.194 -[zane](endpoint-template) +[zane](peers-endpoint-template) aors = zane identify_by=ip [zane](aor-template) @@ -113,7 +114,7 @@ type=identify endpoint=zane match=172.22.167.72 -[sunnet](endpoint-template) +[sunnet](peers-endpoint-template) aors = sunnet identify_by=ip [sunnet](aor-template) @@ -123,7 +124,7 @@ type=identify endpoint=sunnet match=10.127.11.130 -[hertz](endpoint-template) +[hertz](peers-endpoint-template) aors = hertz identify_by=ip [hertz](aor-template) @@ -133,7 +134,7 @@ type=identify endpoint=hertz match=172.20.29.73 -[jrb0001](endpoint-template) +[jrb0001](peers-endpoint-template) aors = jrb0001 identify_by=ip allow=!all,opus48,opus,ulaw,speex,alaw