Outbound 'hello-world' problems

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Outbound 'hello-world' problems

Johannes Vanderknyff
Hello, I am banging my head on how to make an outbound call:

Or more simply, what do I need to do in the 'dial' command to call an extension? (in this case user2)

In asterisk's iax.conf, I have two users defined:
user1 and user2
In the extensions.conf, I have:
[adhearsion]
exten => 100,1,Dial(IAX2/user1)
exten => 101,1,Dial(IAX2/user2)
exten => _X.,1,AGI(agi:async)

which allows user1 to call user2 successfully by dialing 101.

Now that works, I have a basic app configured in adhearsion:

class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    hangup
  end
end

So, when user1 (which is registered in the 'adhearsion' context in asterisk) calls anything like '234', they hear 'hello-world' and a hangup.

So far, so good. But now I am trying to figure out how place an outbound call so I figured I would start with a simple join to user2.

So, modified the app as:
class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    dial 'IAX2:user1@localhost'
    logger.info "done!"
    hangup
  end
end

However, I get nothing (or more precisely, I get a dead channel and it never hangs up. I figure I must be doing something wrong in the "extensions, etc". NOTE: in my routes.conf it does have the: 'default' route to the 'HelloWorld' controller.

I've tried
dial '101'
dial 'iax2/user2'
dial 'iax2/user2@localhost'

Any ideas?

Thank you!
Johannes

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Outbound 'hello-world' problems

Ben Klang-2
Hello!

I’ve put some comments below:

Il giorno Nov 9, 2015, alle ore 1:37 PM, Johannes Vanderknyff <[hidden email]> ha scritto:

Hello, I am banging my head on how to make an outbound call:

Or more simply, what do I need to do in the 'dial' command to call an extension? (in this case user2)

In asterisk's iax.conf, I have two users defined:
user1 and user2
In the extensions.conf, I have:
[adhearsion]
exten => 100,1,Dial(IAX2/user1)
exten => 101,1,Dial(IAX2/user2)
exten => _X.,1,AGI(agi:async)

which allows user1 to call user2 successfully by dialing 101.

Now that works, I have a basic app configured in adhearsion:

class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    hangup
  end
end

So, when user1 (which is registered in the 'adhearsion' context in asterisk) calls anything like '234', they hear 'hello-world' and a hangup.

So far, so good. But now I am trying to figure out how place an outbound call so I figured I would start with a simple join to user2.

So, modified the app as:
class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    dial 'IAX2:user1@localhost'
    logger.info "done!"
    hangup
  end
end

Your dial syntax here is incorrect. The target address is passed through unchanged to Asterisk, so you want to format it like you would in extensions.conf:

dial ‘IAX/user1’



However, I get nothing (or more precisely, I get a dead channel and it never hangs up. I figure I must be doing something wrong in the "extensions, etc". NOTE: in my routes.conf it does have the: 'default' route to the 'HelloWorld' controller.

I've tried
dial '101'
dial 'iax2/user2'
dial 'iax2/user2@localhost’

All of these happen to be invalid :)

* “IAX2” isn’t a valid Asterisk channel technology, only “IAX” is (it should not be case-sensitive, but convention is upper-case for the technology portion)
* Dialing ‘101’ doesn’t include any channel technology, so Asterisk doesn’t know where to send it.

You were really close! See if that works and let us know.

/BAK/


-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo



Any ideas?

Thank you!
Johannes

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

signature.asc (858 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Outbound 'hello-world' problems

Johannes Vanderknyff
Thanks Ben,

Works now!

User error on my side...

It was dial 'iax2/user2', I had a typo in my file (It is IAX2 as IAX is not registered as a channel type in asterisk.)

Thanks,
Johannes

On Mon, Nov 9, 2015 at 2:32 PM, Ben Klang <[hidden email]> wrote:
Hello!

I’ve put some comments below:

Il giorno Nov 9, 2015, alle ore 1:37 PM, Johannes Vanderknyff <[hidden email]> ha scritto:

Hello, I am banging my head on how to make an outbound call:

Or more simply, what do I need to do in the 'dial' command to call an extension? (in this case user2)

In asterisk's iax.conf, I have two users defined:
user1 and user2
In the extensions.conf, I have:
[adhearsion]
exten => 100,1,Dial(IAX2/user1)
exten => 101,1,Dial(IAX2/user2)
exten => _X.,1,AGI(agi:async)

which allows user1 to call user2 successfully by dialing 101.

Now that works, I have a basic app configured in adhearsion:

class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    hangup
  end
end

So, when user1 (which is registered in the 'adhearsion' context in asterisk) calls anything like '234', they hear 'hello-world' and a hangup.

So far, so good. But now I am trying to figure out how place an outbound call so I figured I would start with a simple join to user2.

So, modified the app as:
class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    dial 'IAX2:user1@localhost'
    logger.info "done!"
    hangup
  end
end

Your dial syntax here is incorrect. The target address is passed through unchanged to Asterisk, so you want to format it like you would in extensions.conf:

dial ‘IAX/user1’



However, I get nothing (or more precisely, I get a dead channel and it never hangs up. I figure I must be doing something wrong in the "extensions, etc". NOTE: in my routes.conf it does have the: 'default' route to the 'HelloWorld' controller.

I've tried
dial '101'
dial 'iax2/user2'
dial 'iax2/user2@localhost’

All of these happen to be invalid :)

* “IAX2” isn’t a valid Asterisk channel technology, only “IAX” is (it should not be case-sensitive, but convention is upper-case for the technology portion)
* Dialing ‘101’ doesn’t include any channel technology, so Asterisk doesn’t know where to send it.

You were really close! See if that works and let us know.

/BAK/


-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
<a href="tel:%2B1.404.475.4841" value="+14044754841" target="_blank">+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo



Any ideas?

Thank you!
Johannes

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Outbound 'hello-world' problems

Ben Klang-2
Sorry I almost steered you wrong on the channel technology name - I know they moved to IAX2 years ago, but the old name still sticks around in a few places. In any event, glad you got it working.

/BAK/
-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo

Il giorno Nov 9, 2015, alle ore 2:52 PM, Johannes Vanderknyff <[hidden email]> ha scritto:

Thanks Ben,

Works now!

User error on my side...

It was dial 'iax2/user2', I had a typo in my file (It is IAX2 as IAX is not registered as a channel type in asterisk.)

Thanks,
Johannes

On Mon, Nov 9, 2015 at 2:32 PM, Ben Klang <[hidden email]> wrote:
Hello!

I’ve put some comments below:

Il giorno Nov 9, 2015, alle ore 1:37 PM, Johannes Vanderknyff <[hidden email]> ha scritto:

Hello, I am banging my head on how to make an outbound call:

Or more simply, what do I need to do in the 'dial' command to call an extension? (in this case user2)

In asterisk's iax.conf, I have two users defined:
user1 and user2
In the extensions.conf, I have:
[adhearsion]
exten => 100,1,Dial(IAX2/user1)
exten => 101,1,Dial(IAX2/user2)
exten => _X.,1,AGI(agi:async)

which allows user1 to call user2 successfully by dialing 101.

Now that works, I have a basic app configured in adhearsion:

class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    hangup
  end
end

So, when user1 (which is registered in the 'adhearsion' context in asterisk) calls anything like '234', they hear 'hello-world' and a hangup.

So far, so good. But now I am trying to figure out how place an outbound call so I figured I would start with a simple join to user2.

So, modified the app as:
class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    dial 'IAX2:user1@localhost'
    logger.info "done!"
    hangup
  end
end

Your dial syntax here is incorrect. The target address is passed through unchanged to Asterisk, so you want to format it like you would in extensions.conf:

dial ‘IAX/user1’



However, I get nothing (or more precisely, I get a dead channel and it never hangs up. I figure I must be doing something wrong in the "extensions, etc". NOTE: in my routes.conf it does have the: 'default' route to the 'HelloWorld' controller.

I've tried
dial '101'
dial 'iax2/user2'
dial 'iax2/user2@localhost’

All of these happen to be invalid :)

* “IAX2” isn’t a valid Asterisk channel technology, only “IAX” is (it should not be case-sensitive, but convention is upper-case for the technology portion)
* Dialing ‘101’ doesn’t include any channel technology, so Asterisk doesn’t know where to send it.

You were really close! See if that works and let us know.

/BAK/


-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
<a href="tel:%2B1.404.475.4841" value="+14044754841" target="_blank" class="">+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo



Any ideas?

Thank you!
Johannes

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

signature.asc (858 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Outbound 'hello-world' problems

Johannes Vanderknyff
Here is something else that had me confused (perhaps an opportunity for clarity :) )

At this location:
http://adhearsion.com/docs/console

It mentions that you need to run the following to create an outbound call:
AHN> Adhearsion::OutboundCall.originate '[hidden email]', from: '[hidden email]'
However, the IAX format is:
AHN> Adhearsion::OutboundCall.originate 'iax2/user1'
Johannes

On Mon, Nov 9, 2015 at 2:54 PM, Ben Klang <[hidden email]> wrote:
Sorry I almost steered you wrong on the channel technology name - I know they moved to IAX2 years ago, but the old name still sticks around in a few places. In any event, glad you got it working.

/BAK/
-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
<a href="tel:%2B1.404.475.4841" value="+14044754841" target="_blank">+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo

Il giorno Nov 9, 2015, alle ore 2:52 PM, Johannes Vanderknyff <[hidden email]> ha scritto:

Thanks Ben,

Works now!

User error on my side...

It was dial 'iax2/user2', I had a typo in my file (It is IAX2 as IAX is not registered as a channel type in asterisk.)

Thanks,
Johannes

On Mon, Nov 9, 2015 at 2:32 PM, Ben Klang <[hidden email]> wrote:
Hello!

I’ve put some comments below:

Il giorno Nov 9, 2015, alle ore 1:37 PM, Johannes Vanderknyff <[hidden email]> ha scritto:

Hello, I am banging my head on how to make an outbound call:

Or more simply, what do I need to do in the 'dial' command to call an extension? (in this case user2)

In asterisk's iax.conf, I have two users defined:
user1 and user2
In the extensions.conf, I have:
[adhearsion]
exten => 100,1,Dial(IAX2/user1)
exten => 101,1,Dial(IAX2/user2)
exten => _X.,1,AGI(agi:async)

which allows user1 to call user2 successfully by dialing 101.

Now that works, I have a basic app configured in adhearsion:

class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    hangup
  end
end

So, when user1 (which is registered in the 'adhearsion' context in asterisk) calls anything like '234', they hear 'hello-world' and a hangup.

So far, so good. But now I am trying to figure out how place an outbound call so I figured I would start with a simple join to user2.

So, modified the app as:
class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    dial 'IAX2:user1@localhost'
    logger.info "done!"
    hangup
  end
end

Your dial syntax here is incorrect. The target address is passed through unchanged to Asterisk, so you want to format it like you would in extensions.conf:

dial ‘IAX/user1’



However, I get nothing (or more precisely, I get a dead channel and it never hangs up. I figure I must be doing something wrong in the "extensions, etc". NOTE: in my routes.conf it does have the: 'default' route to the 'HelloWorld' controller.

I've tried
dial '101'
dial 'iax2/user2'
dial 'iax2/user2@localhost’

All of these happen to be invalid :)

* “IAX2” isn’t a valid Asterisk channel technology, only “IAX” is (it should not be case-sensitive, but convention is upper-case for the technology portion)
* Dialing ‘101’ doesn’t include any channel technology, so Asterisk doesn’t know where to send it.

You were really close! See if that works and let us know.

/BAK/


-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
<a href="tel:%2B1.404.475.4841" value="+14044754841" target="_blank">+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo



Any ideas?

Thank you!
Johannes

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Outbound 'hello-world' problems

Ben Klang-2

Il giorno Nov 9, 2015, alle ore 3:00 PM, Johannes Vanderknyff <[hidden email]> ha scritto:

Here is something else that had me confused (perhaps an opportunity for clarity :) )

At this location:
http://adhearsion.com/docs/console

It mentions that you need to run the following to create an outbound call:
AHN> Adhearsion::OutboundCall.originate '[hidden email]', from: '[hidden email]'
However, the IAX format is:
AHN> Adhearsion::OutboundCall.originate 'iax2/user1’
Ah, yes, thanks for pointing that out.  The reason is that the address format is telephony-engine specific. Those docs were written using a telephony engine that accepted SIP URIs as the address format.  We probably should update it to include more specific examples for FreeSWITCH and Asterisk.

If you are so inclined, a pull request to that effect would be very welcome:

/BAK/


Johannes

On Mon, Nov 9, 2015 at 2:54 PM, Ben Klang <[hidden email]> wrote:
Sorry I almost steered you wrong on the channel technology name - I know they moved to IAX2 years ago, but the old name still sticks around in a few places. In any event, glad you got it working.

/BAK/
-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
<a href="tel:%2B1.404.475.4841" value="+14044754841" target="_blank" class="">+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo

Il giorno Nov 9, 2015, alle ore 2:52 PM, Johannes Vanderknyff <[hidden email]> ha scritto:

Thanks Ben,

Works now!

User error on my side...

It was dial 'iax2/user2', I had a typo in my file (It is IAX2 as IAX is not registered as a channel type in asterisk.)

Thanks,
Johannes

On Mon, Nov 9, 2015 at 2:32 PM, Ben Klang <[hidden email]> wrote:
Hello!

I’ve put some comments below:

Il giorno Nov 9, 2015, alle ore 1:37 PM, Johannes Vanderknyff <[hidden email]> ha scritto:

Hello, I am banging my head on how to make an outbound call:

Or more simply, what do I need to do in the 'dial' command to call an extension? (in this case user2)

In asterisk's iax.conf, I have two users defined:
user1 and user2
In the extensions.conf, I have:
[adhearsion]
exten => 100,1,Dial(IAX2/user1)
exten => 101,1,Dial(IAX2/user2)
exten => _X.,1,AGI(agi:async)

which allows user1 to call user2 successfully by dialing 101.

Now that works, I have a basic app configured in adhearsion:

class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    hangup
  end
end

So, when user1 (which is registered in the 'adhearsion' context in asterisk) calls anything like '234', they hear 'hello-world' and a hangup.

So far, so good. But now I am trying to figure out how place an outbound call so I figured I would start with a simple join to user2.

So, modified the app as:
class HelloWorld < Adhearsion::CallController
  def run
    answer
    play 'file://hello-world'
    dial 'IAX2:user1@localhost'
    logger.info "done!"
    hangup
  end
end

Your dial syntax here is incorrect. The target address is passed through unchanged to Asterisk, so you want to format it like you would in extensions.conf:

dial ‘IAX/user1’



However, I get nothing (or more precisely, I get a dead channel and it never hangs up. I figure I must be doing something wrong in the "extensions, etc". NOTE: in my routes.conf it does have the: 'default' route to the 'HelloWorld' controller.

I've tried
dial '101'
dial 'iax2/user2'
dial 'iax2/user2@localhost’

All of these happen to be invalid :)

* “IAX2” isn’t a valid Asterisk channel technology, only “IAX” is (it should not be case-sensitive, but convention is upper-case for the technology portion)
* Dialing ‘101’ doesn’t include any channel technology, so Asterisk doesn’t know where to send it.

You were really close! See if that works and let us know.

/BAK/


-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
<a href="tel:%2B1.404.475.4841" value="+14044754841" target="_blank" class="">+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo



Any ideas?

Thank you!
Johannes

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

signature.asc (858 bytes) Download Attachment