Summary: | ASTERISK-26248: chan_pjsip: Error when calling PJSIP client with domain specified | ||
Reporter: | Norbert Varga (codwell) | Labels: | |
Date Opened: | 2016-07-28 05:12:07 | Date Closed: | 2017-02-13 09:38:19.000-0600 |
Priority: | Minor | Regression? | |
Status: | Closed/Complete | Components: | Channels/chan_pjsip Resources/res_pjsip |
Versions: | 13.9.1 | Frequency of Occurrence | |
Related Issues: | |||
Environment: | Attachments: | ( 0) multidomain-pjsip-patch.diff | |
Description: | I'd like to use endpoint with different domains in my system. I have the following config in pjsip.conf:
{code} [1000@mypbx.com] type = endpoint transport = transport-udp-nat disallow = all allow = ulaw direct_media = no rtp_symmetric = yes force_rport = yes rewrite_contact = yes context = test auth = 1000 aors = 1000 [1000] type = auth auth_type = userpass username = test password = xy [1000] type = aor max_contacts = 1 remove_existing = yes {code} In extensions.conf I have: {code} [test] exten => _ZXXX,1,Dial(PJSIP/${EXTEN}@mypbx.com) {code} Register works. When I try to dial 1000 from another extensions, I get this: {code} ERROR[38010]: chan_pjsip.c:1907 request: Unable to create PJSIP channel - endpoint 'mypbx.com' was not found WARNING[38308][C-00000002]: app_dial.c:2429 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination) {code} The problem is that in the dialplan I have to specify the full name of the endpoint (1000@mypbx.com), but in chan_pjsip above line 1907 the host part is taken as endpoint. The only workaround which is worked, but it looks ugly, and I had to look in the code how to workaround this: {code} exten => _ZXXX,1,Dial(PJSIP/@${EXTEN}@mypbx.com) {code} | ||
Comments: | By: Asterisk Team (asteriskteam) 2016-07-28 05:12:07.840-0500 Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report. Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process]. By: Norbert Varga (codwell) 2016-07-31 07:06:19.269-0500 I recently upgraded to 13.10.0. Now it seems calling a PJSIP client is not working, either for multi-domain and single domain account, I got the same error. This configuration was working in 13.9.1. Could you please suggest what's the problem here? {code} -- Executing [1001@pbxtest:1] Dial("PJSIP/1000-00000000", "PJSIP/1001") in new stack [Jul 31 13:45:22] ERROR[5761]: res_pjsip.c:2785 ast_sip_create_dialog_uac: Could not create dialog to endpoint '1001' as URI '1001' is not valid [Jul 31 13:45:22] ERROR[5761]: chan_pjsip.c:1921 request: Failed to create outgoing session to endpoint '1001' [Jul 31 13:45:22] WARNING[5819][C-00000000]: app_dial.c:2432 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination) {code} pjsip.conf: {code} [1000] type = endpoint transport = transport-udp-nat disallow = all allow = ulaw direct_media = no rtp_symmetric = yes force_rport = yes rewrite_contact = yes context = pbxtest auth = pbxtest-1000 aors = 1000 [pbxtest-1000] type = auth auth_type = userpass username = 1000 password = xyz [1000] type = aor max_contacts = 1 remove_existing = yes [1001] type = endpoint transport = transport-udp-nat disallow = all allow = ulaw direct_media = no rtp_symmetric = yes force_rport = yes rewrite_contact = yes context = pbxtest auth = pbxtest-1001 aors = 1001 [pbxtest-1001] type = auth auth_type = userpass username = 1001 password = xyz [1001] type = aor max_contacts = 1 remove_existing = yes {code} extensions.conf: {code} [pbxtest] exten => _ZXXX,1,Dial(PJSIP/${EXTEN}) {code} By: Joshua C. Colp (jcolp) 2016-07-31 07:09:19.055-0500 Are the devices registered? If not then you will get the message you see. By: Norbert Varga (codwell) 2016-07-31 07:29:41.054-0500 Thank you, it's working! That was the problem. Sorry about the noise. By: Norbert Varga (codwell) 2016-08-01 05:10:41.481-0500 The original problem still persist, and currently I'm using call queues and I couldn't make a workaround. I have the following call queue: {code} [pbxtest-sales] member => PJSIP/1000@mypbx.com member => PJSIP/1001@mypbx.com {code} Queue show command shows the members correctly. Extensions.conf: {code} [pbxtest] exten => 2000,1,Answer() same => n,Queue(pbxtest-sales) same => n,Hangup() ; exten => 1000,1,Dial(PJSIP/@1000@mypbx.com) exten => 1000,1,Dial(PJSIP/1000@mypbx.com) ; exten => 1001,1,Dial(PJSIP/@1001@mypbx.com) exten => 1001,1,Dial(PJSIP/1001@mypbx.com) {code} The result is: {code} Executing [2000@pbxtest:1] Answer("PJSIP/1000@mypbx.com-00000025", "") in new stack > 0x7ff0e8009470 -- Probation passed - setting RTP source address to 92.249.245.153:4012 -- Executing [2000@pbxtest:2] Queue("PJSIP/1000@mypbx.com-00000025", "pbxtest-sales") in new stack -- Started music on hold, class 'default', on channel 'PJSIP/1000@mypbx.com-00000025' [2016-08-01 11:59:47] ERROR[7165]: chan_pjsip.c:1915 request: Unable to create PJSIP channel - endpoint 'mypbx.com' was not found {code} I tried both versions in extension.conf (commented out). I think the reason behind this when the members are called, it's called directly bypassing routing. So it seems the original problem in chan_pjsip.c should be fixed... By: Norbert Varga (codwell) 2017-01-10 10:41:53.112-0600 See my patch for fix this issue. By: Rusty Newton (rnewton) 2017-01-10 12:44:42.856-0600 [~codwell] go ahead and get the patch up on Gerrit. Here is the overall process for reference: https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process Here is the Gerrit specific bit: https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage By: Friendly Automation (friendly-automation) 2017-02-13 09:38:20.150-0600 Change 4719 merged by zuul: chan_pjsip: Multidomain endpoint finding on call [https://gerrit.asterisk.org/4719|https://gerrit.asterisk.org/4719] By: Friendly Automation (friendly-automation) 2017-02-13 09:44:46.146-0600 Change 4870 merged by zuul: chan_pjsip: Multidomain endpoint finding on call [https://gerrit.asterisk.org/4870|https://gerrit.asterisk.org/4870] By: Friendly Automation (friendly-automation) 2017-02-13 09:44:48.749-0600 Change 4869 merged by zuul: chan_pjsip: Multidomain endpoint finding on call [https://gerrit.asterisk.org/4869|https://gerrit.asterisk.org/4869] |