Chan_sip to PJSIP settings

hello

I am trying to configure my SIP trunk on PJSIP but getting all sorts of errors.
Its working somewhat fine on chan_sip… atleast outgoing calls…incoming calls are hit and miss.

Any help??

outgoing peer details:

username=+917647866609
secret=password
qualify=yes
insecure=very
host=cg.voip.ims.bsnl.in
outboundproxy=pun.sbc.ims.bsnl.in:80
port=80&5060
fromuser=+917647866609
fromdomain=cg.voip.ims.bsnl.in
dtmfmode=inband
dtmf=inband
canreinvite=yes
authname=+917647866609
auth=+917647866609
type=peer
nat=yes
disallow=all
allow=ulaw&alaw
registertimeout=3600

asterisk logs with SIP debug on

– Reloading module ‘res_pjsip.so’ (Basic SIP resource)
[2023-02-04 09:31:08] ERROR[30394]: res_pjsip_config_wizard.c:1078 object_type_loaded_observer: Unable to load config file ‘pjsip_wizard.conf’
[2023-02-04 09:31:08] ERROR[30394]: res_pjsip_config_wizard.c:1078 object_type_loaded_observer: Unable to load config file ‘pjsip_wizard.conf’
[2023-02-04 09:31:08] WARNING[30394]: res_pjsip/config_transport.c:745 transport_apply: Transport ‘0.0.0.0-udp’ is not fully reloadable, not reloading: protocol, bind, TLS, TCP, ToS, or CoS options.
[2023-02-04 09:31:08] ERROR[30394]: res_pjsip_config_wizard.c:1078 object_type_loaded_observer: Unable to load config file ‘pjsip_wizard.conf’
[2023-02-04 09:31:08] ERROR[30394]: res_pjsip_config_wizard.c:1078 object_type_loaded_observer: Unable to load config file ‘pjsip_wizard.conf’
[2023-02-04 09:31:08] NOTICE[30394]: sorcery.c:1348 sorcery_object_load: Type ‘system’ is not reloadable, maintaining previous values
[2023-02-04 09:31:08] ERROR[6799]: res_pjsip_outbound_registration.c:1655 sip_outbound_registration_regc_alloc: Invalid outbound proxy URI ‘pun.sbc.ims.bsnl.in’ specified on outbound registration ‘+917647866609’
[2023-02-04 09:31:08] ERROR[30394]: res_sorcery_config.c:422 sorcery_config_internal_load: Could not create an object of type ‘registration’ with id ‘+917647866609’ from configuration file ‘pjsip.conf’
[2023-02-04 09:31:08] ERROR[30394]: res_pjsip_config_wizard.c:1078 object_type_loaded_observer: Unable to load config file ‘pjsip_wizard.conf’
== Contact +917647866609/sip:[email protected]:80 has been deleted
– Reloading module ‘res_pjsip_authenticator_digest.so’ (PJSIP authentication resource)
– Reloading module ‘res_resolver_unbound.so’ (Unbound DNS Resolver Support)
[2023-02-04 09:31:08] ERROR[24665]: config_options.c:710 aco_process_config: Unable to load config file ‘resolver_unbound.conf’
– Reloading module ‘res_pjsip_endpoint_identifier_ip.so’ (PJSIP IP endpoint identifier)
[2023-02-04 09:31:08] ERROR[24665]: res_pjsip_config_wizard.c:1078 object_type_loaded_observer: Unable to load config file ‘pjsip_wizard.conf’
– Reloading module ‘res_stir_shaken.so’ (STIR/SHAKEN Module for Asterisk)
[2023-02-04 09:31:08] ERROR[24665]: res_sorcery_config.c:328 sorcery_config_internal_load: Unable to load config file ‘stir_shaken.conf’
[2023-02-04 09:31:08] ERROR[24665]: res_sorcery_config.c:328 sorcery_config_internal_load: Unable to load config file ‘stir_shaken.conf’
[2023-02-04 09:31:08] ERROR[24665]: res_sorcery_config.c:328 sorcery_config_internal_load: Unable to load config file ‘stir_shaken.conf’
[2023-02-04 09:31:08] ERROR[24665]: res_sorcery_config.c:328 sorcery_config_internal_load: Unable to load config file ‘stir_shaken.conf’
– Reloading module ‘res_musiconhold.so’ (Music On Hold Resource)
– Reloading module ‘res_aeap.so’ (Asterisk External Application Protocol Module for Asterisk)
[2023-02-04 09:31:08] ERROR[24665]: res_sorcery_config.c:328 sorcery_config_internal_load: Unable to load config file ‘aeap.conf’
– Reloading module ‘res_crypto.so’ (Cryptographic Digital Signatures)
– Reloading module ‘res_rtp_asterisk.so’ (Asterisk RTP Stack)
== RTP Allocating from port range 10000 → 20000
– Reloading module ‘res_smdi.so’ (Simplified Message Desk Interface (SMDI) Resource)
– Reloading module ‘res_pjsip_outbound_publish.so’ (PJSIP Outbound Publish Support)
– Reloading module ‘res_pjsip_mwi.so’ (PJSIP MWI resource)
– Reloading module ‘res_pjsip_publish_asterisk.so’ (PJSIP Asterisk Event PUBLISH Support)
– Reloading module ‘chan_iax2.so’ (Inter Asterisk eXchange (Ver 2))
[2023-02-04 09:31:08] WARNING[24665]: iax2/firmware.c:235 iax_firmware_reload: Error opening firmware directory ‘/var/lib/asterisk/firmware/iax’: No such file or directory
[2023-02-04 09:31:08] NOTICE[24665]: iax2/provision.c:557 iax_provision_reload: No IAX provisioning configuration found, IAX provisioning disabled.
– Reloading module ‘chan_sip.so’ (Session Initiation Protocol (SIP))
– Reloading module ‘chan_dahdi.so’ (DAHDI Telephony w/PRI & SS7 & MFC/R2)
– Reloading module ‘res_adsi.so’ (ADSI Resource)
– Reloading module ‘res_fax.so’ (Generic FAX Applications)
– Reloading module ‘res_ari.so’ (Asterisk RESTful Interface)
– Reloading module ‘res_pjsip_notify.so’ (CLI/AMI PJSIP NOTIFY Support)
– Reloading module ‘res_pjsip_outbound_registration.so’ (PJSIP Outbound Registration Support)
Reloading SIP
== Using SIP TOS bits 96
== Using SIP CoS mark 4
[2023-02-04 09:31:08] ERROR[6799]: res_pjsip_outbound_registration.c:1655 sip_outbound_registration_regc_alloc: Invalid outbound proxy URI ‘pun.sbc.ims.bsnl.in’ specified on outbound registration ‘+917647866609’
[2023-02-04 09:31:08] ERROR[24665]: res_sorcery_config.c:422 sorcery_config_internal_load: Could not create an object of type ‘registration’ with id ‘+917647866609’ from configuration file ‘pjsip.conf’
[2023-02-04 09:31:08] ERROR[24665]: res_pjsip_config_wizard.c:1078 object_type_loaded_observer: Unable to load config file ‘pjsip_wizard.conf’
– Reloading module ‘app_confbridge.so’ (Conference Bridge Application)
[2023-02-04 09:31:08] NOTICE[24665]: confbridge/conf_config_parser.c:2382 verify_default_profiles: Adding default_menu menu to app_confbridge
– Reloading module ‘res_parking.so’ (Call Parking Resource)
– Remove parkedcalls/71/1, registrar=res_parking/default; con=((nil)); con->root=(nil)
– Remove parkedcalls/72/1, registrar=res_parking/default; con=((nil)); con->root=(nil)
– Remove parkedcalls/73/1, registrar=res_parking/default; con=((nil)); con->root=(nil)
– Remove parkedcalls/74/1, registrar=res_parking/default; con=((nil)); con->root=(nil)
– Remove parkedcalls/75/1, registrar=res_parking/default; con=((nil)); con->root=(nil)
– Remove parkedcalls/76/1, registrar=res_parking/default; con=((nil)); con->root=(nil)
– Remove parkedcalls/77/1, registrar=res_parking/default; con=((nil)); con->root=(nil)
– Remove parkedcalls/78/1, registrar=res_parking/default; con=((nil)); con->root=(nil)
– Remove parkedcalls/70/1, registrar=res_parking; con=((nil)); con->root=(nil)
– Reloading module ‘app_meetme.so’ (MeetMe conference bridge)
– Reloading module ‘cdr_manager.so’ (Asterisk Manager Interface CDR Backend)
– Reloading module ‘cel_manager.so’ (Asterisk Manager Interface CEL Backend)
– Reloading module ‘cel_odbc.so’ (ODBC CEL backend)
– Found CEL table cel@asteriskcdrdb.
– Reloading module ‘app_amd.so’ (Answering Machine Detection Application)
– AMD defaults: initialSilence [2500] greeting [1500] afterGreetingSilence [800] totalAnalysisTime [5000] minimumWordLength [100] betweenWordsSilence [50] maximumNumberOfWords [3] silenceThreshold [256] maximumWordLength [5000]
– Reloading module ‘app_playback.so’ (Sound File Playback Application)
– Reloading module ‘app_flite.so’ (Flite TTS Interface)
[2023-02-04 09:31:08] WARNING[24665]: app_flite.c:76 read_config: Flite: Unable to read config file flite.conf. Using default settings
– Reloading module ‘codec_dahdi.so’ (Generic DAHDI Transcoder Codec Translator)
– Reloading module ‘app_voicemail.so’ (Comedian Mail (Voicemail System))
[2023-02-04 09:31:08] WARNING[24665]: app_voicemail.c:13895 actual_load_config: maxsilence should be less than minsecs or you may get empty messages
– Reloading module ‘codec_ast18_g729.so’ (Digium G.729 Annex A Codec (optimized for x86_64)
– Reloading module ‘app_queue.so’ (True Call Queueing)
[2023-02-04 09:31:09] NOTICE[24665]: app_queue.c:9447 reload_queue_rules: queuerules.conf has not changed since it was last loaded. Not taking any action.
– Remote UNIX connection disconnected
[2023-02-04 09:31:29] ERROR[6799]: res_pjsip.c:1270 create_out_of_dialog_request: Unable to apply outbound proxy on request OPTIONS to endpoint +917647866609 as outbound proxy URI ‘pun.sbc.ims.bsnl.in’ is not valid
[2023-02-04 09:31:29] ERROR[6799]: res_pjsip/pjsip_options.c:877 sip_options_qualify_contact: Unable to create request to qualify contact sip:[email protected]:5060 on AOR +917647866609

Authentication: Outbound 
Registration: Send
Username: +917647866609
Secret: password
SIP Server: cg.voip.ims.bsnl.in
Outbound Proxy: sip:pun.sbc.ims.bsnl.in:80\;lr\;hide
From User: +917647866609
From Domain: cg.voip.ims.bsnl.in

You need pjsip logger, not sip debug, to be one, if you are using chan_pjsip.

If nat=yes was, incorrectly, used because you are behind NAT, you also need the external signalling and media addresses.

The use of dtmfmode=inband is questionable, but needs to be included in the PJSIP configuration if they really need it. dtmf is either ignored, or a synonym of dtmfmode.

I don’t know how port=80&5060 would be handled, but it is invalid. It was either being ignored, or treated as 80. Given the strange port number on the proxy, the latter is possible, in which case that needs to be included on the SIP Server setting.
insecure=very has been ignored for many years. The specific required setting needs to be used. In any case, it has no effect on outbound calls.
username=… will have been ignored in this case, as it only applies to host=dynamic cases (and has been renamed default_user, although unlike “very”, the old value is still recognized).
auth= is either a synonym of authuser, or is ignored.

hello

the above mentioned settings were for the chan_sip. these settings are presently working and i am able to register and make outbound calls.

I am unable to add proper settings for the pjsip, like putting proxy server port 80, the proxy server field does not take port number in the GUI, only IP address.

can you tell me the command to get pjsip logger.

What happened when you entered
sip:pun.sbc.ims.bsnl.in:80\;lr\;hide
Error when you hit submit, error applying config, error in the Asterisk log relating to the proxy, no error message but connected to wrong port?

At the Asterisk command prompt (not a shell prompt) type
pjsip set logger on
You should see
PJSIP logging enabled
Note that this turns off when you reload, so turn it on just before your test call.

What happened when you entered
sip:pun.sbc.ims.bsnl.in:80;lr;hide
Error when you hit submit, error applying config, error in the Asterisk log relating to the proxy, no error message but connected to wrong port?

i was not entering the whole string - sip:pun.sbc.ims.bsnl.in:80;lr;hide
was just entering - pun.sbc.ims.bsnl.in:80

so now the outgoing calls work…but incoming calls plays “number has moved out of coverage area” i dont understand how can a SIP trunk be out of network.

MY incoming settings in chan_sip-

[email protected]:password@:[email protected]:80
<--- Received SIP request (949 bytes) from UDP:218.248.233.213:80 --->
INVITE sip:[email protected]:5160;line=egwytnn SIP/2.0
Via: SIP/2.0/UDP 218.248.233.213:80;branch=z9hG4bKcdvuczzd451ru4u2gz3c4az22T21499
Call-ID: [email protected]
From: <sip:[email protected]>;tag=sbc0503ffjflnko
To: <tel:+91SIP_TRUNK>
CSeq: 1 INVITE
Allow: UPDATE,INFO,PRACK,OPTIONS,INVITE,ACK,BYE,CANCEL
Contact: <sip:218.248.233.213:80;TRC=ffffffff-ffffffff;Dpt=ebca-200>
Max-Forwards: 66
Supported: timer,100rel,histinfo,early-session
Session-Expires: 1800
Min-SE: 600
P-Asserted-Identity: <tel:+91calling_number>
Privacy: none
P-Called-Party-ID: <tel:+91SIP_TRUNK>
P-Notification: caller-control
Content-Length: 210
Content-Type: application/sdp
Content-Disposition: session

v=0
o=- 563689234 563689234 IN IP4 218.248.233.210
s=SBC call
c=IN IP4 218.248.233.210
t=0 0
m=audio 52722 RTP/AVP 8 101 0
a=rtpmap:101 telephone-event/8000
a=ptime:20
a=sendrecv
a=rtpmap:0 PCMU/8000

<--- Transmitting SIP response (402 bytes) to UDP:218.248.233.213:80 --->
SIP/2.0 416 Unsupported URI Scheme
Via: SIP/2.0/UDP 218.248.233.213:80;received=218.248.233.213;branch=z9hG4bKcdvuczzd451ru4u2gz3c4az22T21499
Call-ID: [email protected]
From: <sip:[email protected]>;tag=sbc0503ffjflnko
To: <tel:+91SIP_TRUNK>;tag=z9hG4bKcdvuczzd451ru4u2gz3c4az22T21499
CSeq: 1 INVITE
Server: FPBX-16.0.30(18.14.0)
Content-Length:  0


<--- Received SIP request (399 bytes) from UDP:218.248.233.213:80 --->
ACK sip:[email protected]:5160;line=egwytnn SIP/2.0
Via: SIP/2.0/UDP 218.248.233.213:80;branch=z9hG4bKcdvuczzd451ru4u2gz3c4az22T21499;received=218.248.233.213
Call-ID: [email protected]
From: <sip:[email protected]>;tag=sbc0503ffjflnko
To: <tel:+91SIP_TRUNK>;tag=z9hG4bKcdvuczzd451ru4u2gz3c4az22T21499
CSeq: 1 ACK
Max-Forwards: 70
Content-Length: 0


<--- Received SIP request (949 bytes) from UDP:218.248.233.213:80 --->
INVITE sip:[email protected]:5160;line=egwytnn SIP/2.0
Via: SIP/2.0/UDP 218.248.233.213:80;branch=z9hG4bKaz22a6awducd2ca6z1uma53v3T36748
Call-ID: [email protected]
From: <sip:[email protected]>;tag=sbc0505kliimgkf
To: <tel:+91SIP_TRUNK>
CSeq: 2 INVITE
Allow: UPDATE,INFO,PRACK,OPTIONS,INVITE,ACK,BYE,CANCEL
Contact: <sip:218.248.233.213:80;TRC=ffffffff-ffffffff;Dpt=ebca-200>
Max-Forwards: 66
Supported: timer,100rel,histinfo,early-session
Session-Expires: 1800
Min-SE: 600
P-Asserted-Identity: <tel:+91calling_number>
Privacy: none
P-Called-Party-ID: <tel:+91SIP_TRUNK>
P-Notification: caller-control
Content-Length: 210
Content-Type: application/sdp
Content-Disposition: session

v=0
o=- 563689237 563689237 IN IP4 218.248.233.210
s=SBC call
c=IN IP4 218.248.233.210
t=0 0
m=audio 52738 RTP/AVP 8 101 0
a=rtpmap:101 telephone-event/8000
a=ptime:20
a=sendrecv
a=rtpmap:0 PCMU/8000

<--- Transmitting SIP response (402 bytes) to UDP:218.248.233.213:80 --->
SIP/2.0 416 Unsupported URI Scheme
Via: SIP/2.0/UDP 218.248.233.213:80;received=218.248.233.213;branch=z9hG4bKaz22a6awducd2ca6z1uma53v3T36748
Call-ID: [email protected]
From: <sip:[email protected]>;tag=sbc0505kliimgkf
To: <tel:+91SIP_TRUNK>;tag=z9hG4bKaz22a6awducd2ca6z1uma53v3T36748
CSeq: 2 INVITE
Server: FPBX-16.0.30(18.14.0)
Content-Length:  0


<--- Received SIP request (399 bytes) from UDP:218.248.233.213:80 --->
ACK sip:[email protected]:5160;line=egwytnn SIP/2.0
Via: SIP/2.0/UDP 218.248.233.213:80;branch=z9hG4bKaz22a6awducd2ca6z1uma53v3T36748;received=218.248.233.213
Call-ID: [email protected]
From: <sip:[email protected]>;tag=sbc0505kliimgkf
To: <tel:+91SIP_TRUNK>;tag=z9hG4bKaz22a6awducd2ca6z1uma53v3T36748
CSeq: 2 ACK
Max-Forwards: 70
Content-Length: 0


<--- Received SIP response (452 bytes) from UDP:218.248.233.213:80 --->
SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 117.199.46.0:5160;branch=z9hG4bKPj3a5e82e8-2ee2-412f-bb70-58cf51d0b2f7;rport=15667
Call-ID: 089abb2f-e80e-4d84-acdd-45362afb7592
From: <sip:[email protected]>;tag=8b568b33-6dcd-4f11-9fa2-38c7509663c3
To: <sip:[email protected]>;tag=sbc0505ohr9e0kk
CSeq: 44232 OPTIONS
Warning: 399 22935854.695.ATS.pun-ats01.w.ims.bsnl.in.22.65543 "Unsupport Msg"
Content-Length: 0

Support for tel: URI was only recently added to Asterisk. In Asterisk 18, the first version with tel is 18.15.0; you have 18.14.0. See [ASTERISK-26894] pjsip should support tel uri scheme - Digium/Asterisk JIRA .
Update and retest.

how to upgrade to 18.15??

[root@mnhpbx ~]# yum clean all
Loaded plugins: fastestmirror, versionlock
Cleaning repos: sng-base sng-epel sng-extras sng-pkgs sng-sng7php74 sng-updates
Cleaning up list of fastest mirrors
[root@mnhpbx ~]# yum update
Loaded plugins: fastestmirror, versionlock
Determining fastest mirrors
sng-base                                                                                         | 3.6 kB  00:00:00
sng-epel                                                                                         | 2.9 kB  00:00:00
sng-extras                                                                                       | 2.9 kB  00:00:00
sng-pkgs                                                                                         | 3.4 kB  00:00:00
sng-sng7php74                                                                                    | 3.4 kB  00:00:00
sng-updates                                                                                      | 2.9 kB  00:00:00
(1/7): sng-pkgs/7-8.2003.5.el7.sangoma/x86_64/primary_db                                         | 1.4 MB  00:00:01
(2/7): sng-sng7php74/7-8.2003.5.el7.sangoma/x86_64/primary_db                                    | 123 kB  00:00:00
(3/7): sng-base/7-8.2003.5.el7.sangoma/x86_64/group_gz                                           | 153 kB  00:00:01
(4/7): sng-updates/7-8.2003.5.el7.sangoma/x86_64/primary_db                                      | 4.5 MB  00:00:01
(5/7): sng-base/7-8.2003.5.el7.sangoma/x86_64/primary_db                                         | 6.1 MB  00:00:04
(6/7): sng-extras/7-8.2003.5.el7.sangoma/x86_64/primary_db                                       | 206 kB  00:00:06
(7/7): sng-epel/7-8.2003.5.el7.sangoma/x86_64/primary_db                                         | 7.3 MB  00:00:06
No packages marked for update
[root@mnhpbx ~]# yum upgrade
Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
No packages marked for update

What version are you running right now? From the CLI you can do asterisk-version-switch and switch to 18LTS to have it switch to 18.16.

Be careful with this as this switch does cause downtime while the versions are switched out.

its very confusing
is it 18.16 or 18.14

to go for certified LTS or just LTS version??

[root@mnhpbx ~]# asterisk -rvvv
Asterisk 18.16.0, Copyright (C) 1999 - 2022, Sangoma Technologies Corporation and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 18.14.0 currently running on mnhpbx (pid = 2019)
mnhpbx*CLI> core show version
Asterisk 18.14.0 built by mockbuild @ jenkins7 on a x86_64 running Linux on 2022-08-24 07:32:01 UTC
mnhpbx*CLI> exit
Asterisk cleanly ending (0).
Executing last minute cleanups
[root@mnhpbx ~]# asterisk-version-switch -h

        Current version:  Asterisk 18.16.0 is running

        (LTS) = Long Term Support | (EOL) = End of Life | (S) = Standard

        Press 1 for  Asterisk 13 (EOL)
        Press 2 for  Asterisk 13 Certified (EOL)
        Press 3 for  Asterisk 15 (EOL)
        Press 4 for  Asterisk 16 (EOL)
        Press 5 for  Asterisk 16 Certified (EOL)
        Press 6 for  Asterisk 17 (EOL)
        Press 7 for  Asterisk 18 (LTS)
        Press 8 for  Asterisk 18 Certified (LTS)
        Press 9 for  Asterisk 19 (EOL)
        Press 0 for  Asterisk 20 (LTS)

        Press q to exit and not change your Asterisk Version

This action below will cause Asterisk to stop and all calls in progress will be terminated

another log

What does 501 not implemented means???

2023/02/09 10:43:40.481735 192.168.1.81:5160 -> 218.248.233.213:80
OPTIONS sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 117.196.198.22:5160;rport;branch=z9hG4bKPj1c9d6853-bc3e-4a50-9099-436c7b649548
From: <sip:[email protected]>;tag=d04a5970-c569-450d-8d4d-d7890a9b388e
To: <sip:[email protected]>
Contact: <sip:[email protected]:5160>
Call-ID: c16c51e9-b308-46cd-bd88-170b192ce3dc
CSeq: 11234 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-16.0.33(18.14.0)
Content-Length:  0



2023/02/09 10:43:40.538084 218.248.233.213:80 -> 192.168.1.81:5160
SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 117.196.198.22:5160;branch=z9hG4bKPj1c9d6853-bc3e-4a50-9099-436c7b649548;rport=64991
Call-ID: c16c51e9-b308-46cd-bd88-170b192ce3dc
From: <sip:[email protected]>;tag=d04a5970-c569-450d-8d4d-d7890a9b388e
To: <sip:[email protected]>;tag=sbc0404ilh97lif
CSeq: 11234 OPTIONS
Warning: 399 22935854.695.ATS.pun-ats01.w.ims.bsnl.in.22.65543 "Unsupport Msg"
Content-Length: 0



2023/02/09 10:44:40.481260 192.168.1.81:5160 -> 218.248.233.213:80
OPTIONS sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 117.196.198.22:5160;rport;branch=z9hG4bKPj4a47dd35-4375-46fb-9583-0181bf407902
From: <sip:[email protected]>;tag=5ca044bf-0976-456d-b45b-33a1da2953f3
To: <sip:[email protected]>
Contact: <sip:[email protected]:5160>
Call-ID: c6572569-220c-4648-8633-7fcb6dcfc137
CSeq: 5463 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-16.0.33(18.14.0)
Content-Length:  0



2023/02/09 10:44:40.538033 218.248.233.213:80 -> 192.168.1.81:5160
SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 117.196.198.22:5160;branch=z9hG4bKPj4a47dd35-4375-46fb-9583-0181bf407902;rport=64991
Call-ID: c6572569-220c-4648-8633-7fcb6dcfc137
From: <sip:[email protected]>;tag=5ca044bf-0976-456d-b45b-33a1da2953f3
To: <sip:[email protected]>;tag=sbc0404kpji07ko
CSeq: 5463 OPTIONS
Warning: 399 22935854.695.ATS.pun-ats01.w.ims.bsnl.in.22.65543 "Unsupport Msg"
Content-Length: 0



2023/02/09 10:45:40.481863 192.168.1.81:5160 -> 218.248.233.213:80
OPTIONS sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 117.196.198.22:5160;rport;branch=z9hG4bKPja5cad320-d20e-419e-8174-48b02d0e7d68
From: <sip:[email protected]>;tag=a2a66003-2c69-44fb-b867-a91566a1b596
To: <sip:[email protected]>
Contact: <sip:[email protected]:5160>
Call-ID: c09431b8-8042-4966-bdae-095be2154b13
CSeq: 40822 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-16.0.33(18.14.0)
Content-Length:  0



2023/02/09 10:45:40.539627 218.248.233.213:80 -> 192.168.1.81:5160
SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 117.196.198.22:5160;branch=z9hG4bKPja5cad320-d20e-419e-8174-48b02d0e7d68;rport=64991
Call-ID: c09431b8-8042-4966-bdae-095be2154b13
From: <sip:[email protected]>;tag=a2a66003-2c69-44fb-b867-a91566a1b596
To: <sip:[email protected]>;tag=sbc0404ejm7ooj9
CSeq: 40822 OPTIONS
Warning: 399 22935854.695.ATS.pun-ats01.w.ims.bsnl.in.22.65543 "Unsupport Msg"
Content-Length: 0



2023/02/09 10:46:26.688145 192.168.1.81:5160 -> 218.248.233.213:80
REGISTER sip:cg.voip.ims.bsnl.in:5060 SIP/2.0
Via: SIP/2.0/UDP 117.196.198.22:5160;rport;branch=z9hG4bKPjc612308a-166e-484e-866a-84bb42abfaaf
From: <sip:[email protected]>;tag=e7206c72-8984-45d8-8eb2-060e89e6380c
To: <sip:[email protected]>
Call-ID: 074928b7-4d64-4ca4-b68f-2f51b1c2734f
CSeq: 34134 REGISTER
Contact: <sip:[email protected]:5160;line=egwytnn>
Expires: 0
Max-Forwards: 70
User-Agent: FPBX-16.0.33(18.14.0)
Content-Length:  0



2023/02/09 10:46:26.847866 218.248.233.213:80 -> 192.168.1.81:5160
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 117.196.198.22:5160;branch=z9hG4bKPjc612308a-166e-484e-866a-84bb42abfaaf;received=117.196.198.22;rport=64991
Call-ID: 074928b7-4d64-4ca4-b68f-2f51b1c2734f
From: <sip:[email protected]>;tag=e7206c72-8984-45d8-8eb2-060e89e6380c
To: <sip:[email protected]>;tag=v6av1ru3
CSeq: 34134 REGISTER
WWW-Authenticate: Digest realm="cg.voip.ims.bsnl.in",nonce="Fb16UWWMT0c2YXFzAhRKiA==",algorithm=MD5,qop="auth"
Content-Length: 0



2023/02/09 10:46:26.857160 192.168.1.81:5160 -> 218.248.233.213:80
REGISTER sip:cg.voip.ims.bsnl.in:5060 SIP/2.0
Via: SIP/2.0/UDP 117.196.198.22:5160;rport;branch=z9hG4bKPj2fc7880b-0e05-4308-82b3-5889c863047c
From: <sip:[email protected]>;tag=e7206c72-8984-45d8-8eb2-060e89e6380c
To: <sip:[email protected]>
Call-ID: 074928b7-4d64-4ca4-b68f-2f51b1c2734f
CSeq: 34135 REGISTER
Contact: <sip:[email protected]:5160;line=egwytnn>
Expires: 0
Max-Forwards: 70
User-Agent: FPBX-16.0.33(18.14.0)
Authorization: Digest username="+917647866609", realm="cg.voip.ims.bsnl.in", nonce="Fb16UWWMT0c2YXFzAhRKiA==", uri="sip:cg.voip.ims.bsnl.in:5060", response="1af972d6662c485a468bdfd5b111f14b", algorithm=MD5, cnonce="0b2e5e276b334376858a8bc6b0d99bb7", qop=auth, nc=00000001
Content-Length:  0



2023/02/09 10:46:27.110534 218.248.233.213:80 -> 192.168.1.81:5160
SIP/2.0 200 OK
Via: SIP/2.0/UDP 117.196.198.22:5160;branch=z9hG4bKPj2fc7880b-0e05-4308-82b3-5889c863047c;received=117.196.198.22;rport=64991
Call-ID: 074928b7-4d64-4ca4-b68f-2f51b1c2734f
From: <sip:[email protected]>;tag=e7206c72-8984-45d8-8eb2-060e89e6380c
To: <sip:[email protected]>;tag=wmarazaz
CSeq: 34135 REGISTER
P-Associated-URI: <sip:[email protected]>,<tel:+917647866609>
Accept-Resource-Priority: wps.4
Contact: <sip:[email protected]:5160;line=egwytnn>;q=1;expires=0
Content-Length: 0



2023/02/09 10:46:31.687513 192.168.1.81:5160 -> 218.248.233.213:80
REGISTER sip:cg.voip.ims.bsnl.in:5060 SIP/2.0
Via: SIP/2.0/UDP 117.196.198.22:5160;rport;branch=z9hG4bKPj2630b285-f5d4-4831-ba78-6dfe6d64ad3f
From: <sip:[email protected]>;tag=36228c97-d626-482b-896a-931dcef4c791
To: <sip:[email protected]>
Call-ID: a66278bd-5008-4383-aa21-acc3db621658
CSeq: 30826 REGISTER
Contact: <sip:[email protected]:5160;line=bktuumd>
Expires: 1200
Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, MESSAGE, REFER
Max-Forwards: 70
User-Agent: FPBX-16.0.33(18.14.0)
Content-Length:  0



2023/02/09 10:46:31.957520 218.248.233.213:80 -> 192.168.1.81:5160
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 117.196.198.22:5160;branch=z9hG4bKPj2630b285-f5d4-4831-ba78-6dfe6d64ad3f;received=117.196.198.22;rport=64991
Call-ID: a66278bd-5008-4383-aa21-acc3db621658
From: <sip:[email protected]>;tag=36228c97-d626-482b-896a-931dcef4c791
To: <sip:[email protected]>;tag=32uuv13a
CSeq: 30826 REGISTER
WWW-Authenticate: Digest realm="cg.voip.ims.bsnl.in",nonce="R3xrk/j+oTHlSE274FYaCw==",algorithm=MD5,qop="auth"
Content-Length: 0



2023/02/09 10:46:31.967404 192.168.1.81:5160 -> 218.248.233.213:80
REGISTER sip:cg.voip.ims.bsnl.in:5060 SIP/2.0
Via: SIP/2.0/UDP 117.196.198.22:5160;rport;branch=z9hG4bKPjc16542cb-1796-4721-b110-6ff3d201d924
From: <sip:[email protected]>;tag=36228c97-d626-482b-896a-931dcef4c791
To: <sip:[email protected]>
Call-ID: a66278bd-5008-4383-aa21-acc3db621658
CSeq: 30827 REGISTER
Contact: <sip:[email protected]:5160;line=bktuumd>
Expires: 1200
Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, MESSAGE, REFER
Max-Forwards: 70
User-Agent: FPBX-16.0.33(18.14.0)
Authorization: Digest username="+917647866609", realm="cg.voip.ims.bsnl.in", nonce="R3xrk/j+oTHlSE274FYaCw==", uri="sip:cg.voip.ims.bsnl.in:5060", response="0b2a3f32d8c79c5a080a36deb49e1274", algorithm=MD5, cnonce="3cf83516f2e94e8781c32a396a7b270c", qop=auth, nc=00000001
Content-Length:  0



2023/02/09 10:46:32.188340 218.248.233.213:80 -> 192.168.1.81:5160
SIP/2.0 200 OK
Via: SIP/2.0/UDP 117.196.198.22:5160;branch=z9hG4bKPjc16542cb-1796-4721-b110-6ff3d201d924;received=117.196.198.22;rport=64991
Call-ID: a66278bd-5008-4383-aa21-acc3db621658
From: <sip:[email protected]>;tag=36228c97-d626-482b-896a-931dcef4c791
To: <sip:[email protected]>;tag=c3152uug
CSeq: 30827 REGISTER
P-Associated-URI: <sip:[email protected]>,<tel:+917647866609>
Accept-Resource-Priority: wps.4
Contact: <sip:[email protected]:5160;line=bktuumd>;q=1;expires=1200
Content-Length: 0



2023/02/09 10:46:32.308177 218.248.233.213:80 -> 192.168.1.81:5160
NOTIFY sip:[email protected]:5160;line=bktuumd SIP/2.0
Via: SIP/2.0/UDP 218.248.233.213:80;branch=z9hG4bKwwwcv266ra4v61dg6u6321cuzT11160
Call-ID: [email protected]
From: <sip:[email protected]>;tag=sbc0404lkp7fp7p
To: <sip:[email protected]>
CSeq: 1 NOTIFY
Contact: <sip:218.248.233.213:80;TRC=ffffffff-ffffffff;Dpt=ebca-200>
Max-Forwards: 69
Supported: 100rel
Event: ua-profile
Subscription-State: active
P-Asserted-Identity: <sip:[email protected]>,<tel:+917647866609>
P-Called-Party-ID: <sip:[email protected]>
Content-Length: 187
Content-Type: application/simservs+xml

<?xml version="1.0"?>
<simservs>
  <dial-tone-management>
    <dial-tone-pattern>standard-dial-tone</dial-tone-pattern>
  </dial-tone-management>
  <call-hold active="true"/>
</simservs>


2023/02/09 10:46:32.347910 192.168.1.81:5160 -> 218.248.233.213:80
SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 218.248.233.213:80;received=218.248.233.213;branch=z9hG4bKwwwcv266ra4v61dg6u6321cuzT11160
Call-ID: [email protected]
From: <sip:[email protected]>;tag=sbc0404lkp7fp7p
To: <sip:[email protected]>;tag=z9hG4bKwwwcv266ra4v61dg6u6321cuzT11160
CSeq: 1 NOTIFY
Server: FPBX-16.0.33(18.14.0)
Content-Length:  0



2023/02/09 10:46:40.481460 192.168.1.81:5160 -> 218.248.233.213:80
OPTIONS sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 117.196.198.22:5160;rport;branch=z9hG4bKPj6eaddf99-c4e9-4706-999b-2c5e7b35eaf8
From: <sip:[email protected]>;tag=890539ec-7a6d-43b2-8070-1ed4bec0c357
To: <sip:[email protected]>
Contact: <sip:[email protected]:5160>
Call-ID: bf31bd97-6530-4b04-a5af-5b85686d42c9
CSeq: 61336 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-16.0.33(18.14.0)
Content-Length:  0



2023/02/09 10:46:40.549246 218.248.233.213:80 -> 192.168.1.81:5160
SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 117.196.198.22:5160;branch=z9hG4bKPj6eaddf99-c4e9-4706-999b-2c5e7b35eaf8;rport=64991
Call-ID: bf31bd97-6530-4b04-a5af-5b85686d42c9
From: <sip:[email protected]>;tag=890539ec-7a6d-43b2-8070-1ed4bec0c357
To: <sip:[email protected]>;tag=sbc0404rjfmlmrl
CSeq: 61336 OPTIONS
Warning: 399 22935854.695.ATS.pun-ats01.w.ims.bsnl.in.22.65543 "Unsupport Msg"
Content-Length: 0



2023/02/09 10:47:40.481396 192.168.1.81:5160 -> 218.248.233.213:80
OPTIONS sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 117.196.198.22:5160;rport;branch=z9hG4bKPj7a22d50b-522a-4b42-9fc4-4541e729318d
From: <sip:[email protected]>;tag=4ab16dc1-6f9b-48ff-b8d5-3567688221aa
To: <sip:[email protected]>
Contact: <sip:[email protected]:5160>
Call-ID: af929449-94a9-4151-af7a-b5b86977b625
CSeq: 40624 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-16.0.33(18.14.0)
Content-Length:  0



2023/02/09 10:47:40.560174 218.248.233.213:80 -> 192.168.1.81:5160
SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 117.196.198.22:5160;branch=z9hG4bKPj7a22d50b-522a-4b42-9fc4-4541e729318d;rport=64991
Call-ID: af929449-94a9-4151-af7a-b5b86977b625
From: <sip:[email protected]>;tag=4ab16dc1-6f9b-48ff-b8d5-3567688221aa
To: <sip:[email protected]>;tag=sbc0404ri0phrfj
CSeq: 40624 OPTIONS
Warning: 399 22935854.695.ATS.pun-ats01.w.ims.bsnl.in.22.65543 "Unsupport Msg"
Content-Length: 0



2023/02/09 10:48:40.482258 192.168.1.81:5160 -> 218.248.233.213:80
OPTIONS sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 117.196.198.22:5160;rport;branch=z9hG4bKPj93cb7d10-165b-4f5d-97f5-3c1c39c72ef1
From: <sip:[email protected]>;tag=a035d98e-050e-45d6-9c5c-94aec13a6f02
To: <sip:[email protected]>
Contact: <sip:[email protected]:5160>
Call-ID: 3fc55b9c-91e5-4264-85bb-0e0050e73f4b
CSeq: 55498 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-16.0.33(18.14.0)
Content-Length:  0



2023/02/09 10:48:40.549373 218.248.233.213:80 -> 192.168.1.81:5160
SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 117.196.198.22:5160;branch=z9hG4bKPj93cb7d10-165b-4f5d-97f5-3c1c39c72ef1;rport=64991
Call-ID: 3fc55b9c-91e5-4264-85bb-0e0050e73f4b
From: <sip:[email protected]>;tag=a035d98e-050e-45d6-9c5c-94aec13a6f02
To: <sip:[email protected]>;tag=sbc0404rjhh0im7
CSeq: 55498 OPTIONS
Warning: 399 22935854.695.ATS.pun-ats01.w.ims.bsnl.in.22.65543 "Unsupport Msg"
Content-Length: 0



2023/02/09 10:49:40.482022 192.168.1.81:5160 -> 218.248.233.213:80
OPTIONS sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 117.196.198.22:5160;rport;branch=z9hG4bKPj28f55f4f-d85f-4eb4-bc3c-a123bb9004d3
From: <sip:[email protected]>;tag=d3c835d3-7a86-4ca2-80f2-9a21c4394e38
To: <sip:[email protected]>
Contact: <sip:[email protected]:5160>
Call-ID: b404e32d-c4a3-48f3-8a8c-ad32d3486ad7
CSeq: 3372 OPTIONS
Max-Forwards: 70
User-Agent: FPBX-16.0.33(18.14.0)
Content-Length:  0



2023/02/09 10:49:40.527513 218.248.233.213:80 -> 192.168.1.81:5160
SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 117.196.198.22:5160;branch=z9hG4bKPj28f55f4f-d85f-4eb4-bc3c-a123bb9004d3;rport=64991
Call-ID: b404e32d-c4a3-48f3-8a8c-ad32d3486ad7
From: <sip:[email protected]>;tag=d3c835d3-7a86-4ca2-80f2-9a21c4394e38
To: <sip:[email protected]>;tag=sbc0404jeomlol7
CSeq: 3372 OPTIONS
Warning: 399 22935854.695.ATS.pun-ats01.w.ims.bsnl.in.22.65543 "Unsupport Msg"
Content-Length: 0

The OPTIONS request sent by Asterisk (to perform ‘qualify’) is not implemented by the BSNL server. However, that is not a problem at all, because Asterisk considers any reply, even an error, as indicating that the server is still alive and reachable. This is unrelated to whatever trouble you may be having.

Ok thanks a lot @Stewart1

But my main issue is still there…
no incoming calls when using PJSIP…
patchy incoming calls when using Chan_SIP

For the pjsip case, I don’t understand why your Asterisk upgrade is still showing 18.14.0 when you do ‘core show version’. Perhaps someone from Sangoma can answer this. Did you determine that after the upgrade you are still getting 416 Unsupported URI Scheme ?

i have not upgraded the freepbx still…
i just ran both the commands to see the status…

i just updated to 18.16…

now even outgoing calls are not working!!! “getting all circuits are busy now”

logs

There is no SIP trace in the log. At the Asterisk command prompt, type
pjsip set logger on
you should see
PJSIP Logging Enabled
then make your test call and paste a new log.

@Stewart1

its working for now…
but both incoming and outgoing are patchy

log - outbound and inbound calls

What went wrong with these calls?

On the outbound call, BSNL signaled that the called party was ringing, but the caller hung up before it was answered. What (if anything) did the caller hear? Was the call actually answered?

The inbound call was apparently answered successfully by the IVR, but the caller hung up before entering any options. What actually happened?

Assuming that the signaling is ok but there is one-way or no audio, I suspect that the router/firewall is not passing traffic correctly. Confirm that you have the RTP port range (UDP ports 10000-20000) forwarded to the private address of the PBX (192.168.1.81). If it has a setting for “consistent NAT” or “disable source port rewriting”, make sure those are turned on.

If you still have trouble, post router/firewall make/model and describe any VoIP-related settings. Also, if the router does not have your public IP address on its WAN interface, please explain (ISP does NAT, ISP’s modem is actually configured as a gateway, etc.)

@Stewart1

both incoming and outgoing are working fine as of now…
and audio is there both sides…

logs