[asterisk-dev] Local channel origination issue.

Kevin P. Fleming kpfleming at digium.com
Tue Oct 11 07:30:59 CDT 2011


On 10/11/2011 07:19 AM, Yaroslav Panych wrote:
> Hello
>
> Have next dialplan
>
> [vsm-context]
> exten=>_listener-.,1,NoOp(VSM-LISTENER-${EXTEN:9})
> same=>n,Set(ORDERNUM=${EXTEN:9})
> same=>n,DumpChan()
> same=>n,UserEvent(VSM-L,CHANNEL:${CHANNEL(name)},ORDERNUM:${ORDERNUM})
> same=>n,MeetMe(CONN_${ORDERNUM},Cdlq1)
> same=>n,Hangup()
>
> exten=>_record-.,1,NoOp(VSM-RECORD-${EXTEN:7})
> same=>n,Set(ORDERNUM=${EXTEN:7})
> same=>n,UserEvent(VSM-R,CHANNEL:${CHANNEL(name)},ORDERNUM:${ORDERNUM})
> same=>n,Record(${VSMFILE}.alaw,0,86400,anqx)
>
> dialplan show vsm-context:
> [ Context 'vsm-context' created by 'pbx_config' ]
>    '_listener-.' =>   1. NoOp(VSM-LISTENER-${EXTEN:9})              [pbx_config]
>                      2. Set(ORDERNUM=${EXTEN:9})                   [pbx_config]
>                      3. DumpChan()                                 [pbx_config]
>                      4.
> UserEvent(VSM-L,CHANNEL:${CHANNEL(name)},ORDERNUM:${ORDERNUM})
> [pbx_config]
>                      5. MeetMe(CONN_${ORDERNUM},Cdlq1)             [pbx_config]
>                      6. Hangup()                                   [pbx_config]
>    '_record-.' =>     1. NoOp(VSM-RECORD-${EXTEN:7})                [pbx_config]
>                      2. Set(ORDERNUM=${EXTEN:7})                   [pbx_config]
>                      3.
> UserEvent(VSM-R,CHANNEL:${CHANNEL(name)},ORDERNUM:${ORDERNUM})
> [pbx_config]
>                      4. Record(${VSMFILE}.alaw,0,86400,anqx)       [pbx_config]
> i.e. dialplan was parsed without issues.
>
> Now I want to originate call to local channel. Doing this with AMI:
> action:originate
> channel:local/listener-11 at vsm-context
> context:vsm-context
> exten:record-11
> priority:1
> async:true
> codecs:alaw
> timeout:10
>
> I'm expect new local channel to be create, with one leg into
> listener-11 at vsm-context, other into record-11 at vsm-context , but
> unfortunately, I got next NOTICE
> [Oct 11 15:00:06] NOTICE[3513]: chan_local.c:895 local_call: No such
> extension/context listener-11 at vsm-context while calling Local channel
> [Oct 11 15:00:06] NOTICE[3513]: channel.c:5291 __ast_request_and_dial:
> Unable to call channel local/listener-11 at vsm-context
>
> But when I remove _ and . from extension definition(i.e. hardcode
> sigle extension not pattern) it works.
> What I'm doing wrong? Why extension patterns does not works here?

Various alphabet characters have special meanings in extension patterns: 
n, x, z, etc. The 'n' in 'listener' is not being matched to a literal 
'n', it's looking for a digit between 0 and 9.

To work around this, you'll need to use '[n]' instead of 'n'. This has 
nothing to do with Local channels, by the way, it's just how extension 
pattern matching works.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
Jabber: kfleming at digium.com | SIP: kpfleming at digium.com | Skype: kpfleming
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list