• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Routing calls based on a leading number

Explorer ,
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

Is it possible to use different profile based on a padded phone number?  Reminiscent of the 'Dial 9 to get out'

i.e. 812345678901

8 = a routing number

12345678901 the phone to call.

I tried changing my workflow.xml without luck

<Context name="rtmp">

     <Condition variable="destNum" value="^8.*$">

          <AppNode sequence="1" app="bridge" args="sip|${destNum}@myContext8"/>

          <AppNode sequence="2" app="hangup" args="null"/>

     </Condition>

</Context>

<Context name="rtmp">

     <Condition variable="destNum" value="^9.*$">

          <AppNode sequence="1" app="bridge" args="sip|${destNum}@myContext9"/>

          <AppNode sequence="2" app="hangup" args="null"/>

     </Condition>

</Context>

TOPICS
Media gateway

Views

981

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Feb 07, 2012 Feb 07, 2012

   $1 variable in below example would contain the substring after removing prefix 8.

    <Condition variable="destNum" value="^8(.*)$">

          <AppNode sequence="1" app="bridge" args="sip|$1@myContext8"/>

          <AppNode sequence="2" app="hangup" args="null"/>

     </Condition>

Votes

Translate

Translate
Guest
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

All conditions need to go into one context node (e.g. rtmp in your case). See changed node after strikethrough.

<Context name="rtmp">

     <Condition variable="destNum" value="^8(.*)$">

          <AppNode sequence="1" app="bridge" args="sip|$1@myContext8"/>

          <AppNode sequence="2" app="hangup" args="null"/>

     </Condition>

</Context>

<Context name="rtmp">

     <Condition variable="destNum" value="^9(.*)$">

          <AppNode sequence="1" app="bridge" args="sip|$1@myContext9"/>

          <AppNode sequence="2" app="hangup" args="null"/>

     </Condition>

</Context>

There must be a SIP profileID myContext8 & myContext9 in sip.xml to point to your sip gateway.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

Thanks Pankaj, but I am sorry I typed my example wrong. My XML does look like your striked out example.

My main question is can I get a substring from destNum?  If I could send "812345678901" to my application and use "8" for routing and then send "12345678901" to my SIP provider, I could route calls based on location easier.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

   $1 variable in below example would contain the substring after removing prefix 8.

    <Condition variable="destNum" value="^8(.*)$">

          <AppNode sequence="1" app="bridge" args="sip|$1@myContext8"/>

          <AppNode sequence="2" app="hangup" args="null"/>

     </Condition>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

LATEST

Thanks Pankaj. That is EXACTLY what I needed!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines