Puzzled by NAT

Hi all, I’m setting up a PBX for our company with the main purpose of learning more about SIP/PBX setups.

We use VoIP phones in our company. I took one of the numbers and used it as a trunk for my setup. After some fiddling I managed to get it to work with one small weird issue. I have the IP configuration set to “Static IP.” I can make calls out the trunk with no problems but when trying to receive calls, I’m getting the Telco announcement “The number is not in use.” My SIP trunk shows up as Registered at the same time.

Now when I switch the IP configuration to “Public IP” I can make and receive calls. BUT, on incoming calls I have no outgoing audio. i.e the person calling via telco, can not hear me.

This is where it gets interesting. When I switch back to “Static IP” after using “Static IP” then absolutely everything works (Incoming calls, outgoing calls, audio both ways) for about 5 minutes. After that I’m getting the “Number is not in use” announcement again - while “sip show peers”, “sip show registry” both show the trunk as OK/Registered

My sip settings:

sip*CLI> sip show settings

Global Settings:

UDP Bindaddress: 0.0.0.0:5060
TCP SIP Bindaddress: Disabled
TLS SIP Bindaddress: Disabled
Videosupport: Yes
Textsupport: No
Ignore SDP sess. ver.: No
AutoCreate Peer: Off
Match Auth Username: No
Allow unknown access: No
Allow subscriptions: Yes
Allow overlap dialing: Yes
Allow promisc. redir: No
Enable call counters: No
SIP domain support: No
Path support : No
Realm. auth: No
Our auth realm asterisk
Use domains as realms: No
Call to non-local dom.: Yes
URI user is phone no: No
Always auth rejects: Yes
Direct RTP setup: No
User Agent: FPBX-14.0.1.9(13.15.0)
SDP Session Name: Asterisk PBX 13.15.0
SDP Owner Name: root
Reg. context: (not set)
Regexten on Qualify: No
Trust RPID: No
Send RPID: No
Legacy userfield parse: No
Send Diversion: Yes
Caller ID: Unknown
From: Domain:
Record SIP history: Off
Auth. Failure Events: Off
T.38 support: No
T.38 EC mode: Unknown
T.38 MaxDtgrm: 4294967295
SIP realtime: Disabled
Qualify Freq : 60000 ms
Q.850 Reason header: No
Store SIP_CAUSE: No

Network QoS Settings:

IP ToS SIP: CS3
IP ToS RTP audio: EF
IP ToS RTP video: AF41
IP ToS RTP text: CS0
802.1p CoS SIP: 4
802.1p CoS RTP audio: 5
802.1p CoS RTP video: 6
802.1p CoS RTP text: 5
Jitterbuffer enabled: No

Network Settings:

SIP address remapping: Disabled
Externhost:
Externaddr: (null)
Externrefresh: 10
Localnet: 192.168.1.0/255.255.255.0

Global Signalling Settings:

Codecs: (alaw|ulaw|g722|h263|h264|h263p|vp8|mpeg4)
Relax DTMF: No
RFC2833 Compensation: No
Symmetric RTP: Yes
Compact SIP headers: No
RTP Keepalive: 0 (Disabled)
RTP Timeout: 30
RTP Hold Timeout: 300
MWI NOTIFY mime type: application/simple-message-summary
DNS SRV lookup: Yes
Pedantic SIP support: Yes
Reg. min duration 60 secs
Reg. max duration: 3600 secs
Reg. default duration: 120 secs
Sub. min duration 60 secs
Sub. max duration: 3600 secs
Outbound reg. timeout: 20 secs
Outbound reg. attempts: 0
Outbound reg. retry 403:No
Notify ringing state: Yes
Include CID: No
Notify hold state: Yes
SIP Transfer mode: open
Max Call Bitrate: 384 kbps
Auto-Framing: No
Outb. proxy:
Session Timers: Accept
Session Refresher: uas
Session Expires: 1800 secs
Session Min-SE: 90 secs
Timer T1: 500
Timer T1 minimum: 100
Timer B: 32000
No premature media: Yes
Max forwards: 70

Default Settings:

Allowed transports: UDP
Outbound transport: UDP
Context: from-sip-external
Record on feature: automon
Record off feature: automon
Force rport: Yes
DTMF: rfc2833
Qualify: 0
Keepalive: 0
Use ClientCode: No
Progress inband: No
Language: en
Tone zone:
MOH Interpret: default
MOH Suggest:
Voice Mail Extension: *97
RTCP Multiplexing: No

My network setup:

SIP server behind NAT at office1. UDP ports 5060, 5061 and 10001 - 20000 open and forwarded to SIP server.
Some extensions at office1, some at office2(different location, behind their own firewall) and there will be a number of extensions used from mobiles. The above problem description and test results were with an extension at office2.

And a log of a call with “Public IP” The call times out in 31 seconds due to lack of RTP activity

= Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [[email protected]:1] Set(“SIP/TELCO_TRUNK-0000008b”, “__DIRECTION=INBOUND”) in new stack
– Executing [[email protected]:2] Gosub(“SIP/TELCO_TRUNK-0000008b”, “sub-record-check,s,1(in,372XXXXXXX,dontcare)”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “0?initialized”) in new stack
– Executing [[email protected]:2] Set(“SIP/TELCO_TRUNK-0000008b”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [[email protected]:3] Set(“SIP/TELCO_TRUNK-0000008b”, “NOW=1506920032”) in new stack
– Executing [[email protected]:4] Set(“SIP/TELCO_TRUNK-0000008b”, “__DAY=02”) in new stack
– Executing [[email protected]:5] Set(“SIP/TELCO_TRUNK-0000008b”, “__MONTH=10”) in new stack
– Executing [[email protected]:6] Set(“SIP/TELCO_TRUNK-0000008b”, “__YEAR=2017”) in new stack
– Executing [[email protected]:7] Set(“SIP/TELCO_TRUNK-0000008b”, “__TIMESTR=20171002-075352”) in new stack
– Executing [[email protected]:8] Set(“SIP/TELCO_TRUNK-0000008b”, “__FROMEXTEN=unknown”) in new stack
– Executing [[email protected]:9] Set(“SIP/TELCO_TRUNK-0000008b”, “__MON_FMT=wav”) in new stack
– Executing [[email protected]:10] NoOp(“SIP/TELCO_TRUNK-0000008b”, “Recordings initialized”) in new stack
– Executing [[email protected]:11] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [[email protected]:12] Set(“SIP/TELCO_TRUNK-0000008b”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [[email protected]:14] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “2?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [[email protected]:17] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “1?sub-record-check,in,1”) in new stack
– Goto (sub-record-check,in,1)
– Executing [[email protected]:1] NoOp(“SIP/TELCO_TRUNK-0000008b”, “Inbound Recording Check to 372XXXXXXX”) in new stack
– Executing [[email protected]:2] Set(“SIP/TELCO_TRUNK-0000008b”, “FROMEXTEN=unknown”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “12?Set(FROMEXTEN=MY_MOBILE)”) in new stack
– Executing [[email protected]:4] Gosub(“SIP/TELCO_TRUNK-0000008b”, “recordcheck,1(dontcare,in,372XXXXXXX)”) in new stack
– Executing [[email protected]:1] NoOp(“SIP/TELCO_TRUNK-0000008b”, “Starting recording check against dontcare”) in new stack
– Executing [[email protected]:2] Goto(“SIP/TELCO_TRUNK-0000008b”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [[email protected]:3] Return(“SIP/TELCO_TRUNK-0000008b”, “”) in new stack
– Executing [[email protected]:5] Return(“SIP/TELCO_TRUNK-0000008b”, “”) in new stack
– Executing [[email protected]:3] Set(“SIP/TELCO_TRUNK-0000008b”, “__FROM_DID=372XXXXXXX”) in new stack
– Executing [372XXX[email protected]:4] Set(“SIP/TELCO_TRUNK-0000008b”, “CDR(did)=372XXXXXXX”) in new stack
– Executing [[email protected]:5] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “1 ?Set(CALLERID(name)=MY_MOBILE)”) in new stack
– Executing [[email protected]:6] Set(“SIP/TELCO_TRUNK-0000008b”, “__MOHCLASS=”) in new stack
– Executing [[email protected]:7] Ringing(“SIP/TELCO_TRUNK-0000008b”, “”) in new stack
– Executing [[email protected]:8] Set(“SIP/TELCO_TRUNK-0000008b”, “__RINGINGSENT=TRUE”) in new stack
– Executing [[email protected]:9] Set(“SIP/TELCO_TRUNK-0000008b”, “__REVERSAL_REJECT=FALSE”) in new stack
– Executing [[email protected]:10] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “1?post-reverse-charge”) in new stack
– Goto (from-trunk,372XXXXXXX,12)
– Executing [[email protected]:12] NoOp(“SIP/TELCO_TRUNK-0000008b”, “”) in new stack
– Executing [[email protected]:13] Set(“SIP/TELCO_TRUNK-0000008b”, “__CALLINGNAMEPRES_SV=allowed_not_screened”) in new stack
– Executing [[email protected]:14] Set(“SIP/TELCO_TRUNK-0000008b”, “__CALLINGNUMPRES_SV=allowed_not_screened”) in new stack
– Executing [[email protected]:15] Set(“SIP/TELCO_TRUNK-0000008b”, “CALLERID(name-pres)=allowed_not_screened”) in new stack
– Executing [[email protected]:16] Set(“SIP/TELCO_TRUNK-0000008b”, “CALLERID(num-pres)=allowed_not_screened”) in new stack
– Executing [[email protected]:17] NoOp(“SIP/TELCO_TRUNK-0000008b”, “CallerID Entry Point”) in new stack
– Executing [[email protected]:18] Goto(“SIP/TELCO_TRUNK-0000008b”, “ext-group,1000,1”) in new stack
– Goto (ext-group,1000,1)
– Executing [[email protected]:1] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “0?cid”) in new stack
– Executing [[email protected]:2] PlayTones(“SIP/TELCO_TRUNK-0000008b”, “ring”) in new stack
– Executing [[email protected]:3] Progress(“SIP/TELCO_TRUNK-0000008b”, “”) in new stack
– Executing [[email protected]:4] Macro(“SIP/TELCO_TRUNK-0000008b”, “user-callerid,”) in new stack
– Executing [[email protected]:1] Set(“SIP/TELCO_TRUNK-0000008b”, “TOUCH_MONITOR=1506920032.145”) in new stack
– Executing [[email protected]:2] Set(“SIP/TELCO_TRUNK-0000008b”, “AMPUSER=MY_MOBILE”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “0?report”) in new stack
– Executing [[email protected]:4] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “1?Set(__REALCALLERIDNUM=MY_MOBILE)”) in new stack
– Executing [[email protected]:5] Set(“SIP/TELCO_TRUNK-0000008b”, “AMPUSER=”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “0?limit”) in new stack
– Executing [[email protected]:7] Set(“SIP/TELCO_TRUNK-0000008b”, “AMPUSERCIDNAME=”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “1?report”) in new stack
– Goto (macro-user-callerid,s,14)
– Executing [[email protected]:14] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “0?continue”) in new stack
– Executing [[email protected]:15] Set(“SIP/TELCO_TRUNK-0000008b”, “__TTL=6”) in new stack
– Executing [[email protected]:16] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,27)
– Executing [[email protected]:27] Set(“SIP/TELCO_TRUNK-0000008b”, “CALLERID(number)=MY_MOBILE”) in new stack
– Executing [[email protected]:28] Set(“SIP/TELCO_TRUNK-0000008b”, “CALLERID(name)=MY_MOBILE”) in new stack
– Executing [[email protected]:29] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “0?cnum”) in new stack
– Executing [[email protected]:30] Set(“SIP/TELCO_TRUNK-0000008b”, “CDR(cnam)=MY_MOBILE”) in new stack
– Executing [[email protected]er-callerid:31] Set(“SIP/TELCO_TRUNK-0000008b”, “CDR(cnum)=MY_MOBILE”) in new stack
– Executing [[email protected]:32] Set(“SIP/TELCO_TRUNK-0000008b”, “CHANNEL(language)=en”) in new stack
– Executing [[email protected]:5] Macro(“SIP/TELCO_TRUNK-0000008b”, “blkvm-setifempty,”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “1?init”) in new stack
– Goto (macro-blkvm-setifempty,s,4)
– Executing [[email protected]:4] Set(“SIP/TELCO_TRUNK-0000008b”, “__BLKVM_CHANNEL=SIP/TELCO_TRUNK-0000008b”) in new stack
– Executing [[email protected]:5] Set(“SIP/TELCO_TRUNK-0000008b”, “SHARED(BLKVM,SIP/TELCO_TRUNK-0000008b)=TRUE”) in new stack
– Executing [[email protected]:6] Set(“SIP/TELCO_TRUNK-0000008b”, “GOSUB_RETVAL=TRUE”) in new stack
– Executing [[email protected]:7] MacroExit(“SIP/TELCO_TRUNK-0000008b”, “”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “1?skipov”) in new stack
– Goto (ext-group,1000,9)
– Executing [[email protected]:9] Set(“SIP/TELCO_TRUNK-0000008b”, “RRNODEST=”) in new stack
– Executing [[email protected]:10] Set(“SIP/TELCO_TRUNK-0000008b”, “__NODEST=1000”) in new stack
– Executing [[email protected]:11] GosubIf(“SIP/TELCO_TRUNK-0000008b”, “0?sub-rgsetcid,s,1()”) in new stack
– Executing [[email protected]:12] Gosub(“SIP/TELCO_TRUNK-0000008b”, “sub-record-check,s,1(rg,1000,dontcare)”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “12?initialized”) in new stack
– Goto (sub-record-check,s,10)
– Executing [[email protected]:10] NoOp(“SIP/TELCO_TRUNK-0000008b”, “Recordings initialized”) in new stack
– Executing [[email protected]:11] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [[email protected]:12] Set(“SIP/TELCO_TRUNK-0000008b”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [[email protected]:14] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “2?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [[email protected]:17] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “0?sub-record-check,rg,1”) in new stack
– Executing [[email protected]:18] NoOp(“SIP/TELCO_TRUNK-0000008b”, “Generic rg Recording Check - MY_MOBILE 1000”) in new stack
– Executing [[email protected]:19] Gosub(“SIP/TELCO_TRUNK-0000008b”, “recordcheck,1(dontcare,rg,1000)”) in new stack
– Executing [[email protected]:1] NoOp(“SIP/TELCO_TRUNK-0000008b”, “Starting recording check against dontcare”) in new stack
– Executing [[email protected]:2] Goto(“SIP/TELCO_TRUNK-0000008b”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [[email protected]:3] Return(“SIP/TELCO_TRUNK-0000008b”, “”) in new stack
– Executing [[email protected]:20] Return(“SIP/TELCO_TRUNK-0000008b”, “”) in new stack
– Executing [[email protected]:13] Set(“SIP/TELCO_TRUNK-0000008b”, “RingGroupMethod=firstavailable”) in new stack
– Executing [[email protected]:14] Set(“SIP/TELCO_TRUNK-0000008b”, “__ALT_CONFIRM_MSG=”) in new stack
– Executing [[email protected]:15] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “0?RGVQANNOUNCE:NORGVQANNOUNCE”) in new stack
– Goto (ext-group,1000,18)
– Executing [[email protected]:18] Macro(“SIP/TELCO_TRUNK-0000008b”, “dial,20,HhTtr,1001”) in new stack
– Executing [[email protected]:1] NoOp(“SIP/TELCO_TRUNK-0000008b”, "Blind Transfer: , Attended Transfer: , User: , Alert Info: ") in new stack
– Executing [[email protected]:2] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(ALERT_INFO=)”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(ALERT_INFO=)”) in new stack
– Executing [[email protected]:4] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(ALERT_INFO=)”) in new stack
– Executing [[email protected]:5] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(CHANNEL(musicclass)=)”) in new stack
– Executing [[email protected]:6] AGI(“SIP/TELCO_TRUNK-0000008b”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
dialparties.agi: Caller ID name is ‘MY_MOBILE’ number is 'MY_MOBILE’
dialparties.agi: CW Ignore is:
dialparties.agi: CF Ignore is:
dialparties.agi: CW IN_USE/BUSY is: 1
> dialparties.agi: USE_CONFIRMATION: ‘FALSE’
> dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is ‘firstavailable’
– dialparties.agi: Added extension 1001 to extension map
– dialparties.agi: Extension 1001 cf is disabled
– dialparties.agi: Extension 1001 do not disturb is disabled
> dialparties.agi: extnum 1001 has: cw: 1; hascfb: 0 [] hascfu: 0 []
dialparties.agi: EXTENSION_STATE: 0 (NOT_INUSE)
dialparties.agi: Extension 1001 has ExtensionState: 0
– dialparties.agi: Filtered ARG3: 1001
> dialparties.agi: NODEST: 1000 adding M(auto-blkvm) to dialopts: HhTtrM(auto-blkvm)
> dialparties.agi: NODEST: 1000 blkvm enabled macro already in dialopts: HhTtrM(auto-blkvm)
dialparties.agi: RVOL_MODE ''
dialparties.agi: RVOL is:
dialparties.agi: RVOLPARENT is:
– <SIP/TELCO_TRUNK-0000008b>AGI Script dialparties.agi completed, returning 0
– Executing [[email protected]:26] NoOp(“SIP/TELCO_TRUNK-0000008b”, “Returned from dialparties with 1 hunt members to dial”) in new stack
– Executing [[email protected]:27] Set(“SIP/TELCO_TRUNK-0000008b”, “HuntLoop=0”) in new stack
– Executing [[email protected]:28] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(HuntMembers=0)”) in new stack
– Executing [[email protected]:29] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “1?a30”) in new stack
– Goto (macro-dial,s,32)
– Executing [[email protected]:32] Set(“SIP/TELCO_TRUNK-0000008b”, “HuntMember=HuntMember0”) in new stack
– Executing [[email protected]:33] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “1?a32:a35”) in new stack
– Goto (macro-dial,s,34)
– Executing [[email protected]:34] Set(“SIP/TELCO_TRUNK-0000008b”, “CT_EXTEN=1001”) in new stack
– Executing [[email protected]:35] Set(“SIP/TELCO_TRUNK-0000008b”, “EXTTOCALL=1001”) in new stack
– Executing [[email protected]:36] Set(“SIP/TELCO_TRUNK-0000008b”, “__PICKUPMARK=1001”) in new stack
– Executing [[email protected]:37] Set(“SIP/TELCO_TRUNK-0000008b”, “DB(CALLTRACE/1001)=MY_MOBILE”) in new stack
– Executing [[email protected]:38] Goto(“SIP/TELCO_TRUNK-0000008b”, “s,huntstart”) in new stack
– Goto (macro-dial,s,47)
– Executing [[email protected]:47] NoOp(“SIP/TELCO_TRUNK-0000008b”, “Hunt Dial Start”) in new stack
– Executing [[email protected]:48] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(HASH(__SIPHEADERS,Alert-Info)=Normal;volume=)”) in new stack
– Executing [[email protected]:49] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(HASH(__SIPHEADERS,Alert-Info)=Normal;volume=)”) in new stack
– Executing [[email protected]:50] Macro(“SIP/TELCO_TRUNK-0000008b”, “dial-hunt-predial-hook,”) in new stack
– Executing [[email protected]:1] MacroExit(“SIP/TELCO_TRUNK-0000008b”, “”) in new stack
– Executing [[email protected]:51] Dial(“SIP/TELCO_TRUNK-0000008b”, “SIP/1002&SIP/1003&SIP/1001,20,HhtrM(auto-blkvm)b(func-apply-sipheaders^s^1),”) in new stack
[2017-10-02 07:53:53] WARNING[5732][C-00000720]: app_dial.c:2525 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
== Using SIP VIDEO TOS bits 136
== Using SIP VIDEO CoS mark 6
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
== Using SIP VIDEO TOS bits 136
== Using SIP VIDEO CoS mark 6
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– SIP/1003-0000008c Internal Gosub(func-apply-sipheaders,s,1) start
– Executing [[email protected]:1] NoOp(“SIP/1003-0000008c”, “Applying SIP Headers to channel”) in new stack
– Executing [[email protected]:2] Set(“SIP/1003-0000008c”, “SIPHEADERKEYS=”) in new stack
– Executing [[email protected]:3] While(“SIP/1003-0000008c”, “0”) in new stack
– Jumping to priority 6
– Executing [[email protected]:7] Return(“SIP/1003-0000008c”, “”) in new stack
== Spawn extension (from-internal, 1000, 1) exited non-zero on ‘SIP/1003-0000008c’
– SIP/1003-0000008c Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
– SIP/1001-0000008d Internal Gosub(func-apply-sipheaders,s,1) start
– Executing [[email protected]:1] NoOp(“SIP/1001-0000008d”, “Applying SIP Headers to channel”) in new stack
– Executing [[email protected]:2] Set(“SIP/1001-0000008d”, “SIPHEADERKEYS=”) in new stack
– Executing [[email protected]:3] While(“SIP/1001-0000008d”, “0”) in new stack
– Jumping to priority 6
– Executing [[email protected]:7] Return(“SIP/1001-0000008d”, “”) in new stack
== Spawn extension (from-internal, 1000, 1) exited non-zero on ‘SIP/1001-0000008d’
– SIP/1001-0000008d Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
– Called SIP/1003
– Called SIP/1001
– SIP/1001-0000008d connected line has changed. Saving it until answer for SIP/TELCO_TRUNK-0000008b
– SIP/1003-0000008c connected line has changed. Saving it until answer for SIP/TELCO_TRUNK-0000008b
– Got SIP response 486 “Busy Here” back from OFFICE2_IP:5060
– SIP/1003-0000008c is busy
– SIP/1001-0000008d is ringing
– SIP/1001-0000008d connected line has changed. Saving it until answer for SIP/TELCO_TRUNK-0000008b
– SIP/1001-0000008d answered SIP/TELCO_TRUNK-0000008b
– Executing [[email protected]:1] Set(“SIP/1001-0000008d”, “__MACRO_RESULT=”) in new stack
– Executing [[email protected]:2] Set(“SIP/1001-0000008d”, “CFIGNORE=”) in new stack
– Executing [[email protected]:3] Set(“SIP/1001-0000008d”, “MASTER_CHANNEL(CFIGNORE)=”) in new stack
– Executing [[email protected]:4] Set(“SIP/1001-0000008d”, “FORWARD_CONTEXT=from-internal”) in new stack
– Executing [[email protected]:5] Set(“SIP/1001-0000008d”, “MASTER_CHANNEL(FORWARD_CONTEXT)=from-internal”) in new stack
– Executing [[email protected]:6] Macro(“SIP/1001-0000008d”, “blkvm-clr,”) in new stack
– Executing [[email protected]:1] Set(“SIP/1001-0000008d”, “SHARED(BLKVM,SIP/TELCO_TRUNK-0000008b)=”) in new stack
– Executing [[email protected]:2] Set(“SIP/1001-0000008d”, “GOSUB_RETVAL=”) in new stack
– Executing [[email protected]:3] MacroExit(“SIP/1001-0000008d”, “”) in new stack
– Executing [[email protected]:7] ExecIf(“SIP/1001-0000008d”, “0?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=1001)”) in new stack
– Executing [[email protected]:8] ExecIf(“SIP/1001-0000008d”, “0?Set(MASTER_CHANNEL(CONNECTEDLINE(name))=Rait)”) in new stack
– Channel SIP/1001-0000008d joined ‘simple_bridge’ basic-bridge <00e1a062-da1c-40b2-a803-1571e133edb9>
– Channel SIP/TELCO_TRUNK-0000008b joined ‘simple_bridge’ basic-bridge <00e1a062-da1c-40b2-a803-1571e133edb9>
> 0xb6b1fb38 – Probation passed - setting RTP source address to TELCO_IP:54370
[2017-10-02 07:54:12] WARNING[14643]: chan_sip.c:4131 retrans_pkt: Timeout on 54d74e938401f00d1ec201ccd58fdd68 on non-critical invite transaction.
[2017-10-02 07:54:29] NOTICE[14643]: chan_sip.c:29516 check_rtp_timeout: Disconnecting call ‘SIP/1001-0000008d’ for lack of RTP activity in 31 seconds
– Channel SIP/1001-0000008d left ‘simple_bridge’ basic-bridge <00e1a062-da1c-40b2-a803-1571e133edb9>
– Channel SIP/TELCO_TRUNK-0000008b left ‘simple_bridge’ basic-bridge <00e1a062-da1c-40b2-a803-1571e133edb9>
== Spawn extension (macro-dial, s, 51) exited non-zero on ‘SIP/TELCO_TRUNK-0000008b’ in macro ‘dial’
== Spawn extension (ext-group, 1000, 18) exited non-zero on ‘SIP/TELCO_TRUNK-0000008b’
– Executing [[email protected]:1] Macro(“SIP/TELCO_TRUNK-0000008b”, “hangupcall,”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/TELCO_TRUNK-0000008b”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [[email protected]:3] ExecIf(“SIP/TELCO_TRUNK-0000008b”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [[email protected]:4] NoOp(“SIP/TELCO_TRUNK-0000008b”, "SIP/1001-0000008d monior file= ") in new stack
– Executing [[email protected]:5] AGI(“SIP/TELCO_TRUNK-0000008b”, “attendedtransfer-rec-restart.php,SIP/1001-0000008d,”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/attendedtransfer-rec-restart.php
– <SIP/TELCO_TRUNK-0000008b>AGI Script attendedtransfer-rec-restart.php completed, returning 0
– Executing [[email protected]:6] Hangup(“SIP/TELCO_TRUNK-0000008b”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 6) exited non-zero on ‘SIP/TELCO_TRUNK-0000008b’ in macro ‘hangupcall’
== Spawn extension (ext-group, h, 1) exited non-zero on ‘SIP/TELCO_TRUNK-0000008b’

And a log of a successful call after switching between IP configuration back to “Static IP”

= Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [[email protected]:1] Set(“SIP/TELCO_TRUNK-00000091”, “__DIRECTION=INBOUND”) in new stack
– Executing [[email protected]:2] Gosub(“SIP/TELCO_TRUNK-00000091”, “sub-record-check,s,1(in,3726173384,dontcare)”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/TELCO_TRUNK-00000091”, “0?initialized”) in new stack
– Executing [[email protected]:2] Set(“SIP/TELCO_TRUNK-00000091”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [[email protected]:3] Set(“SIP/TELCO_TRUNK-00000091”, “NOW=1506920655”) in new stack
– Executing [[email protected]:4] Set(“SIP/TELCO_TRUNK-00000091”, “__DAY=02”) in new stack
– Executing [[email protected]:5] Set(“SIP/TELCO_TRUNK-00000091”, “__MONTH=10”) in new stack
– Executing [[email protected]:6] Set(“SIP/TELCO_TRUNK-00000091”, “__YEAR=2017”) in new stack
– Executing [[email protected]:7] Set(“SIP/TELCO_TRUNK-00000091”, “__TIMESTR=20171002-080415”) in new stack
– Executing [[email protected]:8] Set(“SIP/TELCO_TRUNK-00000091”, “__FROMEXTEN=unknown”) in new stack
– Executing [[email protected]:9] Set(“SIP/TELCO_TRUNK-00000091”, “__MON_FMT=wav”) in new stack
– Executing [[email protected]:10] NoOp(“SIP/TELCO_TRUNK-00000091”, “Recordings initialized”) in new stack
– Executing [[email protected]:11] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [[email protected]:12] Set(“SIP/TELCO_TRUNK-00000091”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [[email protected]:14] GotoIf(“SIP/TELCO_TRUNK-00000091”, “2?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [[email protected]:17] GotoIf(“SIP/TELCO_TRUNK-00000091”, “1?sub-record-check,in,1”) in new stack
– Goto (sub-record-check,in,1)
– Executing [[email protected]:1] NoOp(“SIP/TELCO_TRUNK-00000091”, “Inbound Recording Check to 3726173384”) in new stack
– Executing [[email protected]:2] Set(“SIP/TELCO_TRUNK-00000091”, “FROMEXTEN=unknown”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/TELCO_TRUNK-00000091”, “12?Set(FROMEXTEN=MY_MOBILE)”) in new stack
– Executing [[email protected]:4] Gosub(“SIP/TELCO_TRUNK-00000091”, “recordcheck,1(dontcare,in,3726173384)”) in new stack
– Executing [[email protected]:1] NoOp(“SIP/TELCO_TRUNK-00000091”, “Starting recording check against dontcare”) in new stack
– Executing [[email protected]:2] Goto(“SIP/TELCO_TRUNK-00000091”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [[email protected]:3] Return(“SIP/TELCO_TRUNK-00000091”, “”) in new stack
– Executing [[email protected]:5] Return(“SIP/TELCO_TRUNK-00000091”, “”) in new stack
– Executing [[email protected]:3] Set(“SIP/TELCO_TRUNK-00000091”, “__FROM_DID=3726173384”) in new stack
– Executing [[email protected]:4] Set(“SIP/TELCO_TRUNK-00000091”, “CDR(did)=3726173384”) in new stack
– Executing [[email protected]:5] ExecIf(“SIP/TELCO_TRUNK-00000091”, “1 ?Set(CALLERID(name)=MY_MOBILE)”) in new stack
– Executing [[email protected]:6] Set(“SIP/TELCO_TRUNK-00000091”, “__MOHCLASS=”) in new stack
– Executing [[email protected]:7] Ringing(“SIP/TELCO_TRUNK-00000091”, “”) in new stack
– Executing [[email protected]:8] Set(“SIP/TELCO_TRUNK-00000091”, “__RINGINGSENT=TRUE”) in new stack
– Executing [[email protected]:9] Set(“SIP/TELCO_TRUNK-00000091”, “__REVERSAL_REJECT=FALSE”) in new stack
– Executing [[email protected]:10] GotoIf(“SIP/TELCO_TRUNK-00000091”, “1?post-reverse-charge”) in new stack
– Goto (from-trunk,3726173384,12)
– Executing [[email protected]:12] NoOp(“SIP/TELCO_TRUNK-00000091”, “”) in new stack
– Executing [3726173[email protected]:13] Set(“SIP/TELCO_TRUNK-00000091”, “__CALLINGNAMEPRES_SV=allowed_not_screened”) in new stack
– Executing [[email protected]:14] Set(“SIP/TELCO_TRUNK-00000091”, “__CALLINGNUMPRES_SV=allowed_not_screened”) in new stack
– Executing [[email protected]:15] Set(“SIP/TELCO_TRUNK-00000091”, “CALLERID(name-pres)=allowed_not_screened”) in new stack
– Executing [[email protected]:16] Set(“SIP/TELCO_TRUNK-00000091”, “CALLERID(num-pres)=allowed_not_screened”) in new stack
– Executing [[email protected]:17] NoOp(“SIP/TELCO_TRUNK-00000091”, “CallerID Entry Point”) in new stack
– Executing [[email protected]:18] Goto(“SIP/TELCO_TRUNK-00000091”, “ext-group,1000,1”) in new stack
– Goto (ext-group,1000,1)
– Executing [[email protected]:1] GotoIf(“SIP/TELCO_TRUNK-00000091”, “0?cid”) in new stack
– Executing [[email protected]:2] PlayTones(“SIP/TELCO_TRUNK-00000091”, “ring”) in new stack
– Executing [[email protected]:3] Progress(“SIP/TELCO_TRUNK-00000091”, “”) in new stack
– Executing [[email protected]:4] Macro(“SIP/TELCO_TRUNK-00000091”, “user-callerid,”) in new stack
– Executing [[email protected]:1] Set(“SIP/TELCO_TRUNK-00000091”, “TOUCH_MONITOR=1506920655.151”) in new stack
– Executing [[email protected]:2] Set(“SIP/TELCO_TRUNK-00000091”, “AMPUSER=MY_MOBILE”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/TELCO_TRUNK-00000091”, “0?report”) in new stack
– Executing [[email protected]:4] ExecIf(“SIP/TELCO_TRUNK-00000091”, “1?Set(__REALCALLERIDNUM=MY_MOBILE)”) in new stack
– Executing [[email protected]:5] Set(“SIP/TELCO_TRUNK-00000091”, “AMPUSER=”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/TELCO_TRUNK-00000091”, “0?limit”) in new stack
– Executing [[email protected]:7] Set(“SIP/TELCO_TRUNK-00000091”, “AMPUSERCIDNAME=”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/TELCO_TRUNK-00000091”, “1?report”) in new stack
– Goto (macro-user-callerid,s,14)
– Executing [[email protected]:14] GotoIf(“SIP/TELCO_TRUNK-00000091”, “0?continue”) in new stack
– Executing [[email protected]:15] Set(“SIP/TELCO_TRUNK-00000091”, “__TTL=6”) in new stack
– Executing [[email protected]:16] GotoIf(“SIP/TELCO_TRUNK-00000091”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,27)
– Executing [[email protected]:27] Set(“SIP/TELCO_TRUNK-00000091”, “CALLERID(number)=MY_MOBILE”) in new stack
– Executing [[email protected]:28] Set(“SIP/TELCO_TRUNK-00000091”, “CALLERID(name)=MY_MOBILE”) in new stack
– Executing [[email protected]:29] GotoIf(“SIP/TELCO_TRUNK-00000091”, “0?cnum”) in new stack
– Executing [[email protected]:30] Set(“SIP/TELCO_TRUNK-00000091”, “CDR(cnam)=MY_MOBILE”) in new stack
– Executing [[email protected]:31] Set(“SIP/TELCO_TRUNK-00000091”, “CDR(cnum)=MY_MOBILE”) in new stack
– Executing [[email protected]:32] Set(“SIP/TELCO_TRUNK-00000091”, “CHANNEL(language)=en”) in new stack
– Executing [[email protected]:5] Macro(“SIP/TELCO_TRUNK-00000091”, “blkvm-setifempty,”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/TELCO_TRUNK-00000091”, “1?init”) in new stack
– Goto (macro-blkvm-setifempty,s,4)
– Executing [[email protected]:4] Set(“SIP/TELCO_TRUNK-00000091”, “__BLKVM_CHANNEL=SIP/TELCO_TRUNK-00000091”) in new stack
– Executing [[email protected]:5] Set(“SIP/TELCO_TRUNK-00000091”, “SHARED(BLKVM,SIP/TELCO_TRUNK-00000091)=TRUE”) in new stack
– Executing [[email protected]:6] Set(“SIP/TELCO_TRUNK-00000091”, “GOSUB_RETVAL=TRUE”) in new stack
– Executing [[email protected]:7] MacroExit(“SIP/TELCO_TRUNK-00000091”, “”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/TELCO_TRUNK-00000091”, “1?skipov”) in new stack
– Goto (ext-group,1000,9)
– Executing [[email protected]:9] Set(“SIP/TELCO_TRUNK-00000091”, “RRNODEST=”) in new stack
– Executing [[email protected]:10] Set(“SIP/TELCO_TRUNK-00000091”, “__NODEST=1000”) in new stack
– Executing [[email protected]:11] GosubIf(“SIP/TELCO_TRUNK-00000091”, “0?sub-rgsetcid,s,1()”) in new stack
– Executing [[email protected]:12] Gosub(“SIP/TELCO_TRUNK-00000091”, “sub-record-check,s,1(rg,1000,dontcare)”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/TELCO_TRUNK-00000091”, “12?initialized”) in new stack
– Goto (sub-record-check,s,10)
– Executing [[email protected]:10] NoOp(“SIP/TELCO_TRUNK-00000091”, “Recordings initialized”) in new stack
– Executing [[email protected]:11] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [[email protected]:12] Set(“SIP/TELCO_TRUNK-00000091”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [[email protected]:14] GotoIf(“SIP/TELCO_TRUNK-00000091”, “2?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [[email protected]:17] GotoIf(“SIP/TELCO_TRUNK-00000091”, “0?sub-record-check,rg,1”) in new stack
– Executing [[email protected]:18] NoOp(“SIP/TELCO_TRUNK-00000091”, “Generic rg Recording Check - MY_MOBILE 1000”) in new stack
– Executing [[email protected]:19] Gosub(“SIP/TELCO_TRUNK-00000091”, “recordcheck,1(dontcare,rg,1000)”) in new stack
– Executing [[email protected]:1] NoOp(“SIP/TELCO_TRUNK-00000091”, “Starting recording check against dontcare”) in new stack
– Executing [[email protected]:2] Goto(“SIP/TELCO_TRUNK-00000091”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [[email protected]:3] Return(“SIP/TELCO_TRUNK-00000091”, “”) in new stack
– Executing [[email protected]:20] Return(“SIP/TELCO_TRUNK-00000091”, “”) in new stack
– Executing [[email protected]:13] Set(“SIP/TELCO_TRUNK-00000091”, “RingGroupMethod=firstavailable”) in new stack
– Executing [[email protected]:14] Set(“SIP/TELCO_TRUNK-00000091”, “__ALT_CONFIRM_MSG=”) in new stack
– Executing [[email protected]:15] GotoIf(“SIP/TELCO_TRUNK-00000091”, “0?RGVQANNOUNCE:NORGVQANNOUNCE”) in new stack
– Goto (ext-group,1000,18)
– Executing [[email protected]:18] Macro(“SIP/TELCO_TRUNK-00000091”, “dial,20,HhTtr,1001”) in new stack
– Executing [[email protected]:1] NoOp(“SIP/TELCO_TRUNK-00000091”, "Blind Transfer: , Attended Transfer: , User: , Alert Info: ") in new stack
– Executing [[email protected]:2] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(ALERT_INFO=)”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(ALERT_INFO=)”) in new stack
– Executing [[email protected]:4] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(ALERT_INFO=)”) in new stack
– Executing [[email protected]:5] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(CHANNEL(musicclass)=)”) in new stack
– Executing [[email protected]:6] AGI(“SIP/TELCO_TRUNK-00000091”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
dialparties.agi: Caller ID name is ‘MY_MOBILE’ number is 'MY_MOBILE’
dialparties.agi: CW Ignore is:
dialparties.agi: CF Ignore is:
dialparties.agi: CW IN_USE/BUSY is: 1
> dialparties.agi: USE_CONFIRMATION: ‘FALSE’
> dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is ‘firstavailable’
– dialparties.agi: Added extension 1001 to extension map
– dialparties.agi: Extension 1001 cf is disabled
– dialparties.agi: Extension 1001 do not disturb is disabled
> dialparties.agi: extnum 1001 has: cw: 1; hascfb: 0 [] hascfu: 0 []
dialparties.agi: EXTENSION_STATE: 0 (NOT_INUSE)
dialparties.agi: Extension 1001 has ExtensionState: 0
– dialparties.agi: Filtered ARG3: 1001
> dialparties.agi: NODEST: 1000 adding M(auto-blkvm) to dialopts: HhTtrM(auto-blkvm)
> dialparties.agi: NODEST: 1000 blkvm enabled macro already in dialopts: HhTtrM(auto-blkvm)
dialparties.agi: RVOL_MODE ''
dialparties.agi: RVOL is:
dialparties.agi: RVOLPARENT is:
– <SIP/TELCO_TRUNK-00000091>AGI Script dialparties.agi completed, returning 0
– Executing [[email protected]:26] NoOp(“SIP/TELCO_TRUNK-00000091”, “Returned from dialparties with 1 hunt members to dial”) in new stack
– Executing [[email protected]:27] Set(“SIP/TELCO_TRUNK-00000091”, “HuntLoop=0”) in new stack
– Executing [[email protected]:28] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(HuntMembers=0)”) in new stack
– Executing [[email protected]:29] GotoIf(“SIP/TELCO_TRUNK-00000091”, “1?a30”) in new stack
– Goto (macro-dial,s,32)
– Executing [[email protected]:32] Set(“SIP/TELCO_TRUNK-00000091”, “HuntMember=HuntMember0”) in new stack
– Executing [[email protected]:33] GotoIf(“SIP/TELCO_TRUNK-00000091”, “1?a32:a35”) in new stack
– Goto (macro-dial,s,34)
– Executing [[email protected]:34] Set(“SIP/TELCO_TRUNK-00000091”, “CT_EXTEN=1001”) in new stack
– Executing [[email protected]:35] Set(“SIP/TELCO_TRUNK-00000091”, “EXTTOCALL=1001”) in new stack
– Executing [[email protected]:36] Set(“SIP/TELCO_TRUNK-00000091”, “__PICKUPMARK=1001”) in new stack
– Executing [[email protected]:37] Set(“SIP/TELCO_TRUNK-00000091”, “DB(CALLTRACE/1001)=MY_MOBILE”) in new stack
– Executing [[email protected]:38] Goto(“SIP/TELCO_TRUNK-00000091”, “s,huntstart”) in new stack
– Goto (macro-dial,s,47)
– Executing [[email protected]:47] NoOp(“SIP/TELCO_TRUNK-00000091”, “Hunt Dial Start”) in new stack
– Executing [[email protected]:48] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(HASH(__SIPHEADERS,Alert-Info)=Normal;volume=)”) in new stack
– Executing [[email protected]:49] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(HASH(__SIPHEADERS,Alert-Info)=Normal;volume=)”) in new stack
– Executing [[email protected]:50] Macro(“SIP/TELCO_TRUNK-00000091”, “dial-hunt-predial-hook,”) in new stack
– Executing [[email protected]:1] MacroExit(“SIP/TELCO_TRUNK-00000091”, “”) in new stack
– Executing [[email protected]:51] Dial(“SIP/TELCO_TRUNK-00000091”, “SIP/1002&SIP/1003&SIP/1001,20,HhtrM(auto-blkvm)b(func-apply-sipheaders^s^1),”) in new stack
[2017-10-02 08:04:16] WARNING[6686][C-0000072d]: app_dial.c:2525 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
== Using SIP VIDEO TOS bits 136
== Using SIP VIDEO CoS mark 6
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
== Using SIP VIDEO TOS bits 136
== Using SIP VIDEO CoS mark 6
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– SIP/1003-00000092 Internal Gosub(func-apply-sipheaders,s,1) start
– Executing [[email protected]:1] NoOp(“SIP/1003-00000092”, “Applying SIP Headers to channel”) in new stack
– Executing [[email protected]:2] Set(“SIP/1003-00000092”, “SIPHEADERKEYS=”) in new stack
– Executing [[email protected]:3] While(“SIP/1003-00000092”, “0”) in new stack
– Jumping to priority 6
– Executing [[email protected]:7] Return(“SIP/1003-00000092”, “”) in new stack
== Spawn extension (from-internal, 1000, 1) exited non-zero on ‘SIP/1003-00000092’
– SIP/1003-00000092 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
– SIP/1001-00000093 Internal Gosub(func-apply-sipheaders,s,1) start
– Executing [[email protected]:1] NoOp(“SIP/1001-00000093”, “Applying SIP Headers to channel”) in new stack
– Executing [[email protected]:2] Set(“SIP/1001-00000093”, “SIPHEADERKEYS=”) in new stack
– Executing [[email protected]:3] While(“SIP/1001-00000093”, “0”) in new stack
– Jumping to priority 6
– Executing [[email protected]:7] Return(“SIP/1001-00000093”, “”) in new stack
== Spawn extension (from-internal, 1000, 1) exited non-zero on ‘SIP/1001-00000093’
– SIP/1001-00000093 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
– Called SIP/1003
– Called SIP/1001
– SIP/1001-00000093 connected line has changed. Saving it until answer for SIP/TELCO_TRUNK-00000091
– SIP/1003-00000092 connected line has changed. Saving it until answer for SIP/TELCO_TRUNK-00000091
– Got SIP response 486 “Busy Here” back from OFFICE2_IP:5060
– SIP/1003-00000092 is busy
– SIP/1001-00000093 is ringing
> 0xb20ead90 – Probation passed - setting RTP source address to OFFICE2_IP:53002
> 0xb20ead90 – Probation passed - setting RTP source address to OFFICE2_IP:53002
– SIP/1001-00000093 connected line has changed. Saving it until answer for SIP/TELCO_TRUNK-00000091
– SIP/1001-00000093 answered SIP/TELCO_TRUNK-00000091
– Executing [[email protected]:1] Set(“SIP/1001-00000093”, “__MACRO_RESULT=”) in new stack
– Executing [[email protected]:2] Set(“SIP/1001-00000093”, “CFIGNORE=”) in new stack
– Executing [[email protected]:3] Set(“SIP/1001-00000093”, “MASTER_CHANNEL(CFIGNORE)=”) in new stack
– Executing [[email protected]:4] Set(“SIP/1001-00000093”, “FORWARD_CONTEXT=from-internal”) in new stack
– Executing [[email protected]:5] Set(“SIP/1001-00000093”, “MASTER_CHANNEL(FORWARD_CONTEXT)=from-internal”) in new stack
– Executing [[email protected]:6] Macro(“SIP/1001-00000093”, “blkvm-clr,”) in new stack
– Executing [[email protected]:1] Set(“SIP/1001-00000093”, “SHARED(BLKVM,SIP/TELCO_TRUNK-00000091)=”) in new stack
– Executing [[email protected]:2] Set(“SIP/1001-00000093”, “GOSUB_RETVAL=”) in new stack
– Executing [[email protected]:3] MacroExit(“SIP/1001-00000093”, “”) in new stack
– Executing [[email protected]:7] ExecIf(“SIP/1001-00000093”, “0?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=1001)”) in new stack
– Executing [[email protected]:8] ExecIf(“SIP/1001-00000093”, “0?Set(MASTER_CHANNEL(CONNECTEDLINE(name))=Rait)”) in new stack
– Channel SIP/1001-00000093 joined ‘simple_bridge’ basic-bridge
> 0xb20ead90 – Probation passed - setting RTP source address to OFFICE2_IP:53002
– Channel SIP/TELCO_TRUNK-00000091 joined ‘simple_bridge’ basic-bridge
> 0xb6b1fb38 – Probation passed - setting RTP source address to TELCO_IP:52022
– Channel SIP/TELCO_TRUNK-00000091 left ‘simple_bridge’ basic-bridge
– Channel SIP/1001-00000093 left ‘simple_bridge’ basic-bridge
== Spawn extension (macro-dial, s, 51) exited non-zero on ‘SIP/TELCO_TRUNK-00000091’ in macro ‘dial’
== Spawn extension (ext-group, 1000, 18) exited non-zero on ‘SIP/TELCO_TRUNK-00000091’
– Executing [[email protected]:1] Macro(“SIP/TELCO_TRUNK-00000091”, “hangupcall,”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/TELCO_TRUNK-00000091”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [[email protected]:3] ExecIf(“SIP/TELCO_TRUNK-00000091”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [[email protected]:4] NoOp(“SIP/TELCO_TRUNK-00000091”, "SIP/1001-00000093 monior file= ") in new stack
– Executing [[email protected]:5] AGI(“SIP/TELCO_TRUNK-00000091”, “attendedtransfer-rec-restart.php,SIP/1001-00000093,”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/attendedtransfer-rec-restart.php
– <SIP/TELCO_TRUNK-00000091>AGI Script attendedtransfer-rec-restart.php completed, returning 0
– Executing [[email protected]:6] Hangup(“SIP/TELCO_TRUNK-00000091”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 6) exited non-zero on ‘SIP/TELCO_TRUNK-00000091’ in macro ‘hangupcall’
== Spawn extension (ext-group, h, 1) exited non-zero on ‘SIP/TELCO_TRUNK-00000091’

I stumbled on a bug report mentioning NAT and one-sided audio issues with Asterisk 13.15. Upgraded to the latest stable version of 13.17.2 - no change.

check your router(s). some of the older ones had a sip timeout set to 30 seconds which would close the port the trunk is using.

Ok, I think I’ve got a step closer to the root cause of my problem.

Using “Public IP” under CHAN SIP settings, I can make and receive calls from the office where the SIP server is located.
All incoming calls show up as: [email protected] (which is the local IP of the SIP server)

So it would seem that the server advertises it’s LAN IP address as public (makes sense, when using the Public IP setting). The down side is that I can make and receive calls on external extensions, but there is no audio, because the calls again come in with the SIP servers local IP.

Now when changing to Static IP or Dynamic IP, the incoming calls have a correct (Office1 external) IP address attached to them and audio works both ways. However, changing from Public to Static or Dynamic changes something else in asterisk settings. Because after the SIP trunk registration times out, it will not get renewed and trying to call the trunk number gives me the Telco announcement “The number is not in use.”

Reading the guides on FreePBX and asterisk setups, it would seem that using either a Static IP or Dynamic IP configuration would indeed be correct in my case.

So this all boils down to one question: what settings get changed when switching between different IP configurations, and how can they affect Telco trunk registration?

Still puzzled. I switched the server to use Public IP again. The trunk was immediately registered with Telco. Then I opened up the file sip_general_additional.conf and manually added in the externip=EXTERNALIPADDRESS

Saved the file, reloaded asterisk. Everything worked for 5 minutes until the trunk registration timed out and failed to register again - giving me the same old “The number s not in use” message.

So it would seem that just defining externip causes the trunk registration to fail. Even though it shows up as registered

Telia372XXXXXXX/XXXXXXX 217.XXX.XXX.4 Yes Yes 5060 OK (3 ms)

under settings->sip settings, set the ip address to be the external public ip of your system. if your pbx is behind a firewall doing nat the public ip will be that of the wan interface on the router. now add your local network in the local network section (.1.e. 192.168.1.0/24). by the way do not click on the detect networks button.