How to call from one softphone extension to another?

I have added two extensions in extensions.conf and connected with two softphones installed on my computer. When I am trying to dial from extension 703 to extension 704 asterisk shows that I am calling, but it hangsup call automatically without connecting the call. please give me the opinions of why is this happening.

Without a console log then we can only guess. It could be NAT related, it could be dialplan related.

-- Executing [703@Internal-Main:3] Playback("PJSIP/704-00000005", "hello-world") in new stack
-- <PJSIP/704-00000005> Playing 'hello-world.gsm' (language 'en')
-- Executing [703@Internal-Main:4] Hangup("PJSIP/704-00000005", "") in new stack

== Spawn extension (Internal-Main, 703, 4) exited non-zero on ‘PJSIP/704-00000005’
– Executing [h@Internal-Main:1] Hangup(“PJSIP/704-00000005”, “”) in new stack
== Spawn extension (Internal-Main, h, 1) exited non-zero on ‘PJSIP/704-00000005’
== Setting global variable ‘SIPDOMAIN’ to ‘...
– Executing [704@Long-Distance:1] NoOp(“PJSIP/703-00000006”, “”) in new stack
– Executing [704@Long-Distance:2] Set(“PJSIP/703-00000006”, “CDR_PROP(disable)=1”) in new stack
– Executing [704@Long-Distance:3] Goto(“PJSIP/703-00000006”, “Internal-Main,704,1”) in new stack
– Goto (Internal-Main,704,1)
– Executing [704@Internal-Main:1] Verbose(“PJSIP/703-00000006”, “1, “User 703 dialed an invalid number.””) in new stack
“User 703 dialed an invalid number.”
– Executing [704@Internal-Main:2] Playback(“PJSIP/703-00000006”, “pbx-invalid”) in new stack
– <PJSIP/703-00000006> Playing ‘pbx-invalid.gsm’ (language ‘en’)
[Sep 21 19:05:15] NOTICE[10980]: res_pjsip/pjsip_distributor.c:659 log_failed_request: Request ‘INVITE’ from ‘“1002” sip:1002@***.**.***.****’ failed for ‘188.165.199.61:5071’ (callid: 7233e73769de7c3867ff97ab51c26156) - No matching endpoint found
– Executing [704@Internal-Main:3] Hangup(“PJSIP/703-00000006”, “”) in new stack
== Spawn extension (Internal-Main, 704, 3) exited non-zero on ‘PJSIP/703-00000006’
– Executing [h@Internal-Main:1] Hangup(“PJSIP/703-00000006”, “”) in new stack
== Spawn extension (Internal-Main, h, 1) exited non-zero on ‘PJSIP/703-00000006’
== Setting global variable ‘SIPDOMAIN’ to ‘...
– Executing [704@Long-Distance:1] NoOp(“PJSIP/703-00000007”, “”) in new stack
– Executing [704@Long-Distance:2] Set(“PJSIP/703-00000007”, “CDR_PROP(disable)=1”) in new stack
– Executing [704@Long-Distance:3] Goto(“PJSIP/703-00000007”, “Internal-Main,704,1”) in new stack
– Goto (Internal-Main,704,1)
– Executing [704@Internal-Main:1] Verbose(“PJSIP/703-00000007”, “1, “User 703 dialed an invalid number.””) in new stack
“User 703 dialed an invalid number.”
– Executing [704@Internal-Main:2] Playback(“PJSIP/703-00000007”, “pbx-invalid”) in new stack
– <PJSIP/703-00000007> Playing ‘pbx-invalid.gsm’ (language ‘en’)
– Executing [704@Internal-Main:3] Hangup(“PJSIP/703-00000007”, “”) in new stack
== Spawn extension (Internal-Main, 704, 3) exited non-zero on ‘PJSIP/703-00000007’
– Executing [h@Internal-Main:1] Hangup(“PJSIP/703-00000007”, “”) in new stack
== Spawn extension (Internal-Main, h, 1) exited non-zero on ‘PJSIP/703-00000007’

From your dialplan,

“User 703 dialed an invalid number.”

So it’s your dialplan logic.

-- Executing [703@Internal-Main:3] Playback("PJSIP/704-0000000a", "hello-world") in new stack
    -- <PJSIP/704-0000000a> Playing 'hello-world.gsm' (language 'en')
    -- Executing [h@Internal-Main:1] Hangup("PJSIP/704-0000000a", "") in new stack
  == Spawn extension (Internal-Main, h, 1) exited non-zero on 'PJSIP/704-0000000a'
  == Setting global variable 'SIPDOMAIN' to '***.**.***.****'
    -- Executing [703@Long-Distance:1] NoOp("PJSIP/704-0000000b", "") in new stack
    -- Executing [703@Long-Distance:2] Set("PJSIP/704-0000000b", "CDR_PROP(disable)=1") in new stack
    -- Executing [703@Long-Distance:3] Goto("PJSIP/704-0000000b", "Internal-Main,703,1") in new stack
    -- Goto (Internal-Main,703,1)
    -- Executing [703@Internal-Main:1] Answer("PJSIP/704-0000000b", "") in new stack
    -- Executing [703@Internal-Main:2] Wait("PJSIP/704-0000000b", "10") in new stack

I just have default asterisk pjsip.conf and extensions.conf

There is a sample extensions.conf which is meant to show some things and a basic PBX example - but they are just that, samples/examples.

If you are using the basic PBX one then you may not have modified it to work with your usage. It expects extensions to be in the “1101-1199” range.

thanks that worked, but I think I need some asterisk 15 instruction book