Fresh install of Freepbx 16.
Grandstream HT841
jpsip only, chansip disabled.
Both on the same lan.
I’ve used Dahdi for years with an old PCI card and it worked flawlessly.
I reinstalled freepbx and decided to move into a VM on a local server.
To replace the Dahdi PCI card I opted for a Grandstream HT841.
4 x analogue phone lines coming in from my telco.
I have tried mulitple configurations, I can get incoming :
telco–>HT841–>freepbx
to work no problem
However after numerous configurtion attemps, for the life of me I cannot get
freepbx–>ht841–>telco
(outgoing calls via the grandstream)
to work
thankfully I have a voip line as well, so I’ve been able to “fall back” on that for outgoing calls.
Currently I have Authentication set to None as well as registration set to none.
As I have numerous local sip extensions, turning pjsip set logger on damn near crashes the log viewer, as the phones are constantly generation log entries.
in my event log I can see what looks like a SIP/2.0 403 Forbidden back from the grandstream
However, on the grandstream itself, under the FXO profile (that I am using) I have “outgoing calls without registration” checked off.
Event log for an outoing call attemps
167617 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] app_stack.c: PJSIP/telco_Line_1-00000065 Internal Gosub(func-apply-sipheaders,s,1(1)) start
167618 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:1] ExecIf(“PJSIP/telco_Line_1-00000065”, “0?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)”) in new stack
167619 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:2] NoOp(“PJSIP/telco_Line_1-00000065”, “Applying SIP Headers to channel PJSIP/telco_Line_1-00000065”) in new stack
167620 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:3] Set(“PJSIP/telco_Line_1-00000065”, “localchan=telco_Line_1-00000065”) in new stack
167621 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:4] Set(“PJSIP/telco_Line_1-00000065”, “DialMCEXT=telco_Line_1”) in new stack
167622 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:5] Set(“PJSIP/telco_Line_1-00000065”, “CHANNEL(hangup_handler_push)=app-missedcall-hangup,telco_Line_1,1”) in new stack
167623 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:6] Set(“PJSIP/telco_Line_1-00000065”, “TECH=PJSIP”) in new stack
167624 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:7] Set(“PJSIP/telco_Line_1-00000065”, “SIPHEADERKEYS=Alert-Info”) in new stack
167625 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:8] While(“PJSIP/telco_Line_1-00000065”, “1”) in new stack
167626 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:9] Set(“PJSIP/telco_Line_1-00000065”, “sipheader=unset”) in new stack
167627 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:10] ExecIf(“PJSIP/telco_Line_1-00000065”, “1?Set(PJSIP_HEADER(remove,Alert-Info)=)”) in new stack
167628 [2025-09-21 17:14:13] ERROR[151468] res_pjsip_header_funcs.c: No headers had been previously added to this session.
167629 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:11] ExecIf(“PJSIP/telco_Line_1-00000065”, “0?Set(sipheader=http://127.0.0.1;info=unset)”) in new stack
167630 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:12] ExecIf(“PJSIP/telco_Line_1-00000065”, “0?Set(sipheader=http://127.0.0.1unset)”) in new stack
167631 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:13] ExecIf(“PJSIP/telco_Line_1-00000065”, “0?Set(PJSIP_HEADER(add,Alert-Info)=unset)”) in new stack
167632 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:14] EndWhile(“PJSIP/telco_Line_1-00000065”, “”) in new stack
167633 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:8] While(“PJSIP/telco_Line_1-00000065”, “0”) in new stack
167634 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [s@func-apply-sipheaders:15] Return(“PJSIP/telco_Line_1-00000065”, “”) in new stack
167635 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] app_stack.c: Spawn extension (func-apply-sipheaders, s, 15) exited non-zero on ‘PJSIP/telco_Line_1-00000065’
167636 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] app_stack.c: PJSIP/telco_Line_1-00000065 Internal Gosub(func-apply-sipheaders,s,1(1)) complete GOSUB_RETVAL=
167637 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] app_dial.c: Called PJSIP/number_i_am_trying_to_dial_out_to@telco_Line_1
167638 [2025-09-21 17:14:13] VERBOSE[122732] res_pjsip_logger.c: <— Transmitting SIP request (1041 bytes) to UDP:ip_of_grandstream:5060 —>
167639 INVITE sip:number_i_am_trying_to_dial_out_to@ip_of_grandstream:5060 SIP/2.0
167640 Via: SIP/2.0/UDP ip_of_freepbx:5060;rport;branch=z9hG4bKPjac289e74-10cf-434e-b775-fe1031e6f726
167641 From: “companyname” sip:phone_number_of_company@ip_of_freepbx;tag=3ad08eb2-c0b3-4772-b770-60c8ab4a2f6a
167642 To: sip:number_i_am_trying_to_dial_out_to@ip_of_grandstream
167643 Contact: sip:asterisk@ip_of_freepbx:5060
167644 Call-ID: 418a9346-97db-4cdc-b2cd-ae764abc7ca6
167645 CSeq: 20124 INVITE
167646 Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, MESSAGE, REFER
167647 Supported: 100rel, timer, replaces, norefersub, histinfo
167648 Session-Expires: 1800
167649 Min-SE: 90
167650 Max-Forwards: 70
167651 User-Agent: FPBX-16.0.41(18.16.0)
167652 Content-Type: application/sdp
167653 Content-Length: 341
167654
167655 v=0
167656 o=- 368562395 368562395 IN IP4 ip_of_freepbx
167657 s=Asterisk
167658 c=IN IP4 ip_of_freepbx
167659 t=0 0
167660 m=audio 18326 RTP/AVP 0 8 3 111 9 101
167661 a=rtpmap:0 PCMU/8000
167662 a=rtpmap:8 PCMA/8000
167663 a=rtpmap:3 GSM/8000
167664 a=rtpmap:111 G726-32/8000
167665 a=rtpmap:9 G722/8000
167666 a=rtpmap:101 telephone-event/8000
167667 a=fmtp:101 0-16
167668 a=ptime:20
167669 a=maxptime:150
167670 a=sendrecv
167671
167672 [2025-09-21 17:14:13] VERBOSE[2454] res_pjsip_logger.c: <— Received SIP response (504 bytes) from UDP:ip_of_grandstream:5060 —>
167673 SIP/2.0 100 Trying
167674 Via: SIP/2.0/UDP ip_of_freepbx:5060;rport=5060;branch=z9hG4bKPjac289e74-10cf-434e-b775-fe1031e6f726
167675 From: “companyname” sip:phone_number_of_company@ip_of_freepbx;tag=3ad08eb2-c0b3-4772-b770-60c8ab4a2f6a
167676 To: sip:number_i_am_trying_to_dial_out_to@ip_of_grandstream
167677 Call-ID: 418a9346-97db-4cdc-b2cd-ae764abc7ca6
167678 CSeq: 20124 INVITE
167679 User-Agent: Grandstream HT841 1.0.9.9
167680 Supported: replaces, path, timer, eventlist
167681 Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
167682 Content-Length: 0
167683
167684
167685 [2025-09-21 17:14:13] VERBOSE[2454] res_pjsip_logger.c: <— Received SIP response (521 bytes) from UDP:ip_of_grandstream:5060 —>
167686 SIP/2.0 403 Forbidden
167687 Via: SIP/2.0/UDP ip_of_freepbx:5060;rport=5060;branch=z9hG4bKPjac289e74-10cf-434e-b775-fe1031e6f726
167688 From: “companyname” sip:phone_number_of_company@ip_of_freepbx;tag=3ad08eb2-c0b3-4772-b770-60c8ab4a2f6a
167689 To: sip:number_i_am_trying_to_dial_out_to@ip_of_grandstream;tag=573418735
167690 Call-ID: 418a9346-97db-4cdc-b2cd-ae764abc7ca6
167691 CSeq: 20124 INVITE
167692 User-Agent: Grandstream HT841 1.0.9.9
167693 Supported: replaces, path, timer, eventlist
167694 Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
167695 Content-Length: 0
167696
167697
167698 [2025-09-21 17:14:13] VERBOSE[59751] res_pjsip_logger.c: <— Transmitting SIP request (425 bytes) to UDP:ip_of_grandstream:5060 —>
167699 ACK sip:number_i_am_trying_to_dial_out_to@ip_of_grandstream:5060 SIP/2.0
167700 Via: SIP/2.0/UDP ip_of_freepbx:5060;rport;branch=z9hG4bKPjac289e74-10cf-434e-b775-fe1031e6f726
167701 From: “companyname” sip:phone_number_of_company@ip_of_freepbx;tag=3ad08eb2-c0b3-4772-b770-60c8ab4a2f6a
167702 To: sip:number_i_am_trying_to_dial_out_to@ip_of_grandstream;tag=573418735
167703 Call-ID: 418a9346-97db-4cdc-b2cd-ae764abc7ca6
167704 CSeq: 20124 ACK
167705 Max-Forwards: 70
167706 User-Agent: FPBX-16.0.41(18.16.0)
167707 Content-Length: 0
167708
167709
167710 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] app_stack.c: PJSIP/telco_Line_1-00000065 Internal Gosub(app-missedcall-hangup,telco_Line_1,1) start
167711 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [telco_Line_1@app-missedcall-hangup:1] NoOp(“PJSIP/telco_Line_1-00000065”, “Dialed: telco_Line_1”) in new stack
167712 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [telco_Line_1@app-missedcall-hangup:2] NoOp(“PJSIP/telco_Line_1-00000065”, “Caller: 401”) in new stack
167713 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [telco_Line_1@app-missedcall-hangup:3] GotoIf(“PJSIP/telco_Line_1-00000065”, “0?exit”) in new stack
167714 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [telco_Line_1@app-missedcall-hangup:4] Set(“PJSIP/telco_Line_1-00000065”, “EXTENNUM=telco_Line_1”) in new stack
167715 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [telco_Line_1@app-missedcall-hangup:5] Set(“PJSIP/telco_Line_1-00000065”, “FEXTENNUM=telco_Line_1”) in new stack
167716 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [telco_Line_1@app-missedcall-hangup:6] GotoIf(“PJSIP/telco_Line_1-00000065”, “0?exit”) in new stack
167717 [2025-09-21 17:14:13] VERBOSE[166784][C-0000002c] pbx.c: Executing [telco_Line_1@app-missedcall-hangup:7] AGI(“PJSIP/telco_Line_1-00000065”, “agi://127.0.0.1/missedcallnotify.php,telco_Line_1,telco_Line_1,0,PJSIP/telco_Line_1-00000065,”) in new stack







