Call cell phone with channel originate

I found a lot of CLIs on net and in this forum but none of them works for me.
e.g.:
channel originate local/cellphonenumber@from-internal extension extesionnumber@from-internal

Did you actually look at the Wiki for the Originate command? The explanation there is pretty straightforward. In spite of that, let me help you a little.

channel originate <tech/data> extension [@][<context>]

What error are you getting in the /var/log/asterisk/full log?

This should actually work. Can you post a call log?

*CLI> channel originate local/123456789@from-internal extension 36@from-internal
– Called 123456789@from-internal
– Executing [123456789@from-internal:1] Macro(“Local/123456789@from-internal-0000002a;2”, “user-callerid,LIMIT,EXTERNAL,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“Local/123456789@from-internal-0000002a;2”, “TOUCH_MONITOR=1594213294.163”) in new stack
– Executing [s@macro-user-callerid:2] Set(“Local/123456789@from-internal-0000002a;2”, “AMPUSER=”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“Local/123456789@from-internal-0000002a;2”, “1?Set(REALCALLERIDNUM=)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“Local/123456789@from-internal-0000002a;2”, “AMPUSER=”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:7] Set(“Local/123456789@from-internal-0000002a;2”, “AMPUSERCIDNAME=”) in new stack
– Executing [s@macro-user-callerid:8] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(__CIDMASQUERADING=TRUE)”) in new stack
– Executing [s@macro-user-callerid:9] GotoIf(“Local/123456789@from-internal-0000002a;2”, “1?report”) in new stack
– Goto (macro-user-callerid,s,17)
– Executing [s@macro-user-callerid:17] NoOp(“Local/123456789@from-internal-0000002a;2”, “Macro Depth is 1”) in new stack
– Executing [s@macro-user-callerid:18] GotoIf(“Local/123456789@from-internal-0000002a;2”, “1?report2:macroerror”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [s@macro-user-callerid:19] GotoIf(“Local/123456789@from-internal-0000002a;2”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,38)
– Executing [s@macro-user-callerid:38] Set(“Local/123456789@from-internal-0000002a;2”, “CALLERID(number)=”) in new stack
– Executing [s@macro-user-callerid:39] Set(“Local/123456789@from-internal-0000002a;2”, “CALLERID(name)=”) in new stack
– Executing [s@macro-user-callerid:40] GotoIf(“Local/123456789@from-internal-0000002a;2”, “1?cnum”) in new stack
– Goto (macro-user-callerid,s,42)
– Executing [s@macro-user-callerid:42] Set(“Local/123456789@from-internal-0000002a;2”, “CDR(cnum)=”) in new stack
– Executing [s@macro-user-callerid:43] Set(“Local/123456789@from-internal-0000002a;2”, “CHANNEL(language)=en”) in new stack
– Executing [123456789@from-internal:2] Gosub(“Local/123456789@from-internal-0000002a;2”, “sub-record-check,s,1(out,123456789,dontcare)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“Local/123456789@from-internal-0000002a;2”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“Local/123456789@from-internal-0000002a;2”, “NOW=1594213294”) in new stack
– Executing [s@sub-record-check:4] Set(“Local/123456789@from-internal-0000002a;2”, “__DAY=08”) in new stack
– Executing [s@sub-record-check:5] Set(“Local/123456789@from-internal-0000002a;2”, “__MONTH=07”) in new stack
– Executing [s@sub-record-check:6] Set(“Local/123456789@from-internal-0000002a;2”, “__YEAR=2020”) in new stack
– Executing [s@sub-record-check:7] Set(“Local/123456789@from-internal-0000002a;2”, “__TIMESTR=20200708-150134”) in new stack
– Executing [s@sub-record-check:8] Set(“Local/123456789@from-internal-0000002a;2”, “__FROMEXTEN=unknown”) in new stack
– Executing [s@sub-record-check:9] Set(“Local/123456789@from-internal-0000002a;2”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“Local/123456789@from-internal-0000002a;2”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“Local/123456789@from-internal-0000002a;2”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“Local/123456789@from-internal-0000002a;2”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“Local/123456789@from-internal-0000002a;2”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] NoOp(“Local/123456789@from-internal-0000002a;2”, “Outbound Recording Check from unknown to 123456789”) in new stack
– Executing [out@sub-record-check:2] Set(“Local/123456789@from-internal-0000002a;2”, “RECMODE=”) in new stack
– Executing [out@sub-record-check:3] ExecIf(“Local/123456789@from-internal-0000002a;2”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [out@sub-record-check:7] Gosub(“Local/123456789@from-internal-0000002a;2”, “recordcheck,1(dontcare,out,123456789)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“Local/123456789@from-internal-0000002a;2”, “Starting recording check against dontcare”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“Local/123456789@from-internal-0000002a;2”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [recordcheck@sub-record-check:3] Return(“Local/123456789@from-internal-0000002a;2”, “”) in new stack
– Executing [out@sub-record-check:8] Return(“Local/123456789@from-internal-0000002a;2”, “”) in new stack
– Executing [123456789@from-internal:3] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0 ?Set(CDR(accountcode)=)”) in new stack
– Executing [123456789@from-internal:4] Set(“Local/123456789@from-internal-0000002a;2”, “MOHCLASS=default”) in new stack
– Executing [123456789@from-internal:5] Set(“Local/123456789@from-internal-0000002a;2”, “_NODEST=”) in new stack
– Executing [123456789@from-internal:6] Macro(“Local/123456789@from-internal-0000002a;2”, “dialout-trunk,2,123456789,off”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“Local/123456789@from-internal-0000002a;2”, “DIAL_TRUNK=2”) in new stack
– Executing [s@macro-dialout-trunk:2] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(DIAL_OPTIONS=tr)”) in new stack
– Executing [s@macro-dialout-trunk:3] GosubIf(“Local/123456789@from-internal-0000002a;2”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:4] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CALLERID(num)=)”) in new stack
– Executing [s@macro-dialout-trunk:5] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“Local/123456789@from-internal-0000002a;2”, “DIAL_NUMBER=123456789”) in new stack
– Executing [s@macro-dialout-trunk:7] Set(“Local/123456789@from-internal-0000002a;2”, “DIAL_TRUNK_OPTIONS=Ttr”) in new stack
– Executing [s@macro-dialout-trunk:8] Set(“Local/123456789@from-internal-0000002a;2”, “OUTBOUND_GROUP=OUT_2”) in new stack
– Executing [s@macro-dialout-trunk:9] Set(“Local/123456789@from-internal-0000002a;2”, “DIAL_TRUNK_OPTIONS=T”) in new stack
– Executing [s@macro-dialout-trunk:10] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?nomax”) in new stack
– Executing [s@macro-dialout-trunk:11] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?chanfull”) in new stack
– Executing [s@macro-dialout-trunk:12] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:13] Macro(“Local/123456789@from-internal-0000002a;2”, “outbound-callerid,2”) in new stack
– Executing [s@macro-outbound-callerid:1] NoOp(“Local/123456789@from-internal-0000002a;2”, “”) in new stack
– Executing [s@macro-outbound-callerid:2] NoOp(“Local/123456789@from-internal-0000002a;2”, “”) in new stack
– Executing [s@macro-outbound-callerid:3] NoOp(“Local/123456789@from-internal-0000002a;2”, “on”) in new stack
– Executing [s@macro-outbound-callerid:4] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CALLERPRES(name-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:5] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CALLERPRES(num-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:6] ExecIf(“Local/123456789@from-internal-0000002a;2”, “1?Set(REALCALLERIDNUM=)”) in new stack
– Executing [s@macro-outbound-callerid:7] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(AMPUSER=unknown)”) in new stack
– Executing [s@macro-outbound-callerid:8] GotoIf(“Local/123456789@from-internal-0000002a;2”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [s@macro-outbound-callerid:12] Set(“Local/123456789@from-internal-0000002a;2”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:13] Set(“Local/123456789@from-internal-0000002a;2”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:14] Set(“Local/123456789@from-internal-0000002a;2”, “TRUNKOUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:15] GotoIf(“Local/123456789@from-internal-0000002a;2”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,21)
– Executing [s@macro-outbound-callerid:21] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:22] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:23] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:24] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CALLERPRES(name-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:25] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CALLERPRES(num-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:26] Set(“Local/123456789@from-internal-0000002a;2”, “CDR(outbound_cnum)=”) in new stack
– Executing [s@macro-outbound-callerid:27] Set(“Local/123456789@from-internal-0000002a;2”, “CDR(outbound_cnam)=”) in new stack
– Executing [s@macro-dialout-trunk:14] GosubIf(“Local/123456789@from-internal-0000002a;2”, “1?sub-flp-2,s,1()”) in new stack
– Executing [s@sub-flp-2:1] ExecIf(“Local/123456789@from-internal-0000002a;2”, “1?Return()”) in new stack
– Executing [s@macro-dialout-trunk:15] Set(“Local/123456789@from-internal-0000002a;2”, “OUTNUM=123456789”) in new stack
– Executing [s@macro-dialout-trunk:16] Set(“Local/123456789@from-internal-0000002a;2”, “custom=SIP/siptrunk”) in new stack
– Executing [s@macro-dialout-trunk:17] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)”) in new stack
– Executing [s@macro-dialout-trunk:18] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:19] Macro(“Local/123456789@from-internal-0000002a;2”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“Local/123456789@from-internal-0000002a;2”, “”) in new stack
– Executing [s@macro-dialout-trunk:20] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?skipcrm”) in new stack
– Executing [s@macro-dialout-trunk:21] Set(“Local/123456789@from-internal-0000002a;2”, “__CRM_DIRECTION=OUTBOUND”) in new stack
– Executing [s@macro-dialout-trunk:22] Set(“Local/123456789@from-internal-0000002a;2”, “__CRM_DESTINATION=123456789”) in new stack
– Executing [s@macro-dialout-trunk:23] Set(“Local/123456789@from-internal-0000002a;2”, “__CRM_SOURCE=”) in new stack
– Executing [s@macro-dialout-trunk:24] AGI(“Local/123456789@from-internal-0000002a;2”, “sangomacrm.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
– <Local/123456789@from-internal-0000002a;2>AGI Script sangomacrm.agi completed, returning 0
– Executing [s@macro-dialout-trunk:25] Set(“Local/123456789@from-internal-0000002a;2”, “CHANNEL(hangup_handler_push)=crm-hangup,s,1”) in new stack
– Executing [s@macro-dialout-trunk:26] NoOp(“Local/123456789@from-internal-0000002a;2”, “CRM Finished”) in new stack
– Executing [s@macro-dialout-trunk:27] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:28] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CONNECTEDLINE(num,i)=123456789)”) in new stack
– Executing [s@macro-dialout-trunk:29] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CONNECTEDLINE(name,i)=CID:)”) in new stack
– Executing [s@macro-dialout-trunk:30] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden))”) in new stack
– Executing [s@macro-dialout-trunk:31] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:32] Dial(“Local/123456789@from-internal-0000002a;2”, “SIP/siptrunk/123456789,300,Tb(func-apply-sipheaders^s^1,(2))”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– SIP/siptrunk-0000004e Internal Gosub(func-apply-sipheaders,s,1(2)) start
– Executing [s@func-apply-sipheaders:1] ExecIf(“SIP/siptrunk-0000004e”, “0?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)”) in new stack
– Executing [s@func-apply-sipheaders:2] NoOp(“SIP/siptrunk-0000004e”, “Applying SIP Headers to channel SIP/siptrunk-0000004e”) in new stack
– Executing [s@func-apply-sipheaders:3] Set(“SIP/siptrunk-0000004e”, “TECH=SIP”) in new stack
– Executing [s@func-apply-sipheaders:4] Set(“SIP/siptrunk-0000004e”, “SIPHEADERKEYS=”) in new stack
– Executing [s@func-apply-sipheaders:5] While(“SIP/siptrunk-0000004e”, “0”) in new stack
– Jumping to priority 11
– Executing [s@func-apply-sipheaders:12] Return(“SIP/siptrunk-0000004e”, “”) in new stack
== Spawn extension (from-trunk, 123456789, 1) exited non-zero on ‘SIP/siptrunk-0000004e’
– SIP/siptrunk-0000004e Internal Gosub(func-apply-sipheaders,s,1(2)) complete GOSUB_RETVAL=
– Called SIP/siptrunk/123456789
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:33] NoOp(“Local/123456789@from-internal-0000002a;2”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 1”) in new stack
– Executing [s@macro-dialout-trunk:34] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?continue,1:s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“Local/123456789@from-internal-0000002a;2”, “RC=1”) in new stack
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“Local/123456789@from-internal-0000002a;2”, “1,1”) in new stack
– Goto (macro-dialout-trunk,1,1)
– Executing [1@macro-dialout-trunk:1] Goto(“Local/123456789@from-internal-0000002a;2”, “s-INVALIDNMBR,1”) in new stack
– Goto (macro-dialout-trunk,s-INVALIDNMBR,1)
– Executing [s-INVALIDNMBR@macro-dialout-trunk:1] NoOp(“Local/123456789@from-internal-0000002a;2”, “Dial failed due to trunk reporting Address Incomplete - giving up”) in new stack
– Executing [s-INVALIDNMBR@macro-dialout-trunk:2] Progress(“Local/123456789@from-internal-0000002a;2”, “”) in new stack
– Executing [s-INVALIDNMBR@macro-dialout-trunk:3] Playback(“Local/123456789@from-internal-0000002a;2”, “ss-noservice,noanswer”) in new stack
– Local/123456789@from-internal-0000002a;1 is making progress
– <Local/123456789@from-internal-0000002a;2> Playing ‘ss-noservice.slin16’ (language ‘en’)
– Executing [s-INVALIDNMBR@macro-dialout-trunk:4] Busy(“Local/123456789@from-internal-0000002a;2”, “20”) in new stack
– Local/123456789@from-internal-0000002a;1 is busy
== Spawn extension (macro-dialout-trunk, s-INVALIDNMBR, 4) exited non-zero on ‘Local/123456789@from-internal-0000002a;2’ in macro ‘dialout-trunk’
== Spawn extension (from-internal, 123456789, 6) exited non-zero on ‘Local/123456789@from-internal-0000002a;2’
– Executing [h@from-internal:1] Macro(“Local/123456789@from-internal-0000002a;2”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“Local/123456789@from-internal-0000002a;2”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] NoOp(“Local/123456789@from-internal-0000002a;2”, " montior file= ") in new stack
– Executing [s@macro-hangupcall:5] GotoIf(“Local/123456789@from-internal-0000002a;2”, “1?skipagi”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [s@macro-hangupcall:7] Hangup(“Local/123456789@from-internal-0000002a;2”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 7) exited non-zero on ‘Local/123456789@from-internal-0000002a;2’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘Local/123456789@from-internal-0000002a;2’
– Local/123456789@from-internal-0000002a;2 Internal Gosub(crm-hangup,s,1) start
– Executing [s@crm-hangup:1] NoOp(“Local/123456789@from-internal-0000002a;2”, “Sending Hangup to CRM”) in new stack
– Executing [s@crm-hangup:2] NoOp(“Local/123456789@from-internal-0000002a;2”, “HANGUP CAUSE: 17”) in new stack
– Executing [s@crm-hangup:3] ExecIf(“Local/123456789@from-internal-0000002a;2”, “0?Set(__CRM_VOICEMAIL=)”) in new stack
– Executing [s@crm-hangup:4] NoOp(“Local/123456789@from-internal-0000002a;2”, “MASTER CHANNEL: 1594213294.163 = 1594213294.163”) in new stack
– Executing [s@crm-hangup:5] GotoIf(“Local/123456789@from-internal-0000002a;2”, “0?return”) in new stack
– Executing [s@crm-hangup:6] Set(“Local/123456789@from-internal-0000002a;2”, “__CRM_HANGUP=1”) in new stack
– Executing [s@crm-hangup:7] AGI(“Local/123456789@from-internal-0000002a;2”, “sangomacrm.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
– <Local/123456789@from-internal-0000002a;2>AGI Script sangomacrm.agi completed, returning 0
– Executing [s@crm-hangup:8] Return(“Local/123456789@from-internal-0000002a;2”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on ‘Local/123456789@from-internal-0000002a;2’
– Local/123456789@from-internal-0000002a;2 Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=

1 - Unallocated (unassigned) number. This cause indicates that the destination requested by the calling user cannot be reached because, although the number is in a valid format, it is not currently assigned (allocated).

Do your outbound routes have a valid dial plan?

1 Like

Yes, I have a valid plan. If I call this mobile number on phone (ext. 36) it works well.

The Originate is working correctly and appears to be trying to dial out. There’s something about either the format of the phone number or the configuration of your outbound trunks that is causing this to jam up.

Try calling from your local extension and look at the half dozen lines before the “Called SIP…” line on the successful call and see if you can spot any differences.

I assume that the provider rejected the call because caller ID was invalid.
You can confirm that by typing
sip set debug on
at the Asterisk command prompt and making another test call.

I am guessing that channel originate doesn’t populate the caller ID from the extension’s Outbound CID. If you don’t care about it (main company number is acceptable), try putting that in the route CID (but with Override Extension off), or you could use a special route for the purpose.

A search may find a better solution, but my quick look showed only custom dial plan.

3 Likes

Hi,

Many thanks for your idea! I found the root cause based on your idea.

I entered extension number e.g. 36 in Route CID of Outbound Routes and set Override Extension to Yes. sip set debug on helped me a lot.
Now it works well.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.