SIP_URI_OPTIONS

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

SIP_URI_OPTIONS

Andrius Kairiukstis-2
Hello,


there is SIP_URI_OPTIONS channel variable in Asterisk, that modifies INVITE, so if I do something like

exten => _X,1,Set(__SIP_URI_OPTIONS=someoption=somevalue)
same => n,Dial(...),

then I will see this SIP invite and to fields if dial some resource:

2016/12/12 18:46:22.138888 172.21.0.68:5060 -> 172.21.0.66:5060
INVITE sip:aaabbbcccdddeee@172.18.200.108;someoption=somevalue
Via: SIP/2.0/UDP 172.21.0.68:5060;branch=z9hG4bK642caac0
Max-Forwards: 70
From: <sip:XXXX@KAMAILIO>;tag=as29b31941
To: <sip:aaabbbcccdddeee@172.18.200.108:45727;someoption=somevalue>
Contact: <sip:XXXX@172.21.0.68:5060>

I am looking for the same option for Adhearsion dial and originate command. I did tests and I am able to specify 'to' field, but not Invite.

originate 'SIP/aaabbbcccddd@185.105.176.67!aaabbbcccddd@KAMAILIO;someoption=somevalue', from: '12345', for: 60

2016/12/12 19:42:56.641168 172.21.0.68:5060 -> 172.21.0.66:5060
INVITE sip:aaabbbcccddd@KAMAILIO SIP/2.0
Via: SIP/2.0/UDP 172.21.0.68:5060;branch=z9hG4bK142f38ae
Max-Forwards: 70
From: <sip:12345@172.21.0.68>;tag=as578e1210
To: <sip:aaabbbcccddd@185.105.176.67;someoption=somevalue>
Contact: <sip:12345@172.21.0.68:5060>

Question, is it possible to get invite updated too somehow?

Regards,
Andrius


--
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: SIP_URI_OPTIONS

Ben Langfeld
You can set channel variables and invoke Dial() using Adhearsion-asterisk. Other than that, no.

Enviado do meu iPhone

Em 12 de dez de 2016, às 17:52, Andrius Kairiukstis <[hidden email]> escreveu:

Hello,


there is SIP_URI_OPTIONS channel variable in Asterisk, that modifies INVITE, so if I do something like

exten => _X,1,Set(__SIP_URI_OPTIONS=someoption=somevalue)
same => n,Dial(...),

then I will see this SIP invite and to fields if dial some resource:

2016/12/12 18:46:22.138888 172.21.0.68:5060 -> 172.21.0.66:5060
INVITE <a href="sip:aaabbbcccdddeee@172.18.200.108">sip:aaabbbcccdddeee@172.18.200.108;someoption=somevalue
Via: SIP/2.0/UDP 172.21.0.68:5060;branch=z9hG4bK642caac0
Max-Forwards: 70
From: <<a href="sip:XXXX@KAMAILIO">sip:XXXX@KAMAILIO>;tag=as29b31941
To: <<a href="sip:aaabbbcccdddeee@172.18.200.108:45727">sip:aaabbbcccdddeee@172.18.200.108:45727;someoption=somevalue>
Contact: <<a href="sip:XXXX@172.21.0.68:5060">sip:XXXX@172.21.0.68:5060>

I am looking for the same option for Adhearsion dial and originate command. I did tests and I am able to specify 'to' field, but not Invite.

originate '[hidden email]!aaabbbcccddd@KAMAILIO;someoption=somevalue', from: '12345', for: 60

2016/12/12 19:42:56.641168 172.21.0.68:5060 -> 172.21.0.66:5060
INVITE <a href="sip:aaabbbcccddd@KAMAILIO">sip:aaabbbcccddd@KAMAILIO SIP/2.0
Via: SIP/2.0/UDP 172.21.0.68:5060;branch=z9hG4bK142f38ae
Max-Forwards: 70
From: <<a href="sip:12345@172.21.0.68">sip:12345@172.21.0.68>;tag=as578e1210
To: <<a href="sip:aaabbbcccddd@185.105.176.67">sip:aaabbbcccddd@185.105.176.67;someoption=somevalue>
Contact: <<a href="sip:12345@172.21.0.68:5060">sip:12345@172.21.0.68:5060>

Question, is it possible to get invite updated too somehow?

Regards,
Andrius


--
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: SIP_URI_OPTIONS

Andrius Kairiukstis-2

On Monday, 12 December 2016 23:40:17 UTC+1, Ben Langfeld wrote:
You can set channel variables and invoke Dial() using Adhearsion-asterisk. Other than that, no.

Hello,

I made an concept with originate and Local channel in asterisk and it would work, but there is small bug in Adhearsion, related to the Local channel

Shortly, when Asterisk dial to the local channel, after bridge, another call leg will be created and it should be tracked, or something like this happen (below)

Channel Local/d2450c9eb93499608f29d1e2e96f4a2f@adhearsion-originate-00000002;1 but at the moment, Local/d2450c9eb93499608f29d1e2e96f4a2f@adhearsion-originate-00000002;2 should be tracked.

I will try to work on this and get it solved.

By now Ben, maybe you could help with this question:

How I can invoke AMI originate within Adhearsion without using originate command?
I just want to send AMI action, same way as it's made in lib/adhearsion/translator/asterisk/call.rb.

I have tried this from adhearsion CLI, but something is missing:
originate_action = Adhearsion::Rayo::Component::Asterisk::AMI::Action.new :name => 'Originate', :params => {:async=>true, :context=>"default", :exten=>"1", :priority=>"1", :channel=>"SIP/aaa", :callerid => "12345", :timeout => 30000}
originate_action.request!

Regards,
Andrius

[2016-12-15 09:39:37.774] DEBUG Adhearsion::OutboundCall: f559727e-7217-4628-b73e-e64d4f1d39c2@: Executing command #<Adhearsion::Rayo::Command::Join target_call_id=nil, target_mix
er_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Thu, 15 Dec 2016 09:39:37 +0000, request_id="7ca5aec6-ca2a-47be-add5-de2522e1a3e9", call_uri="f
559727e-7217-4628-b73e-e64d4f1d39c2", mixer_name=nil, direction=nil, media=nil>
[2016-12-15 09:39:37.776] TRACE Adhearsion::Rayo::Connection::Asterisk: [SEND] Action: agi
ActionID: a9f31819-11f6-4bb3-b6f2-d7428006afa2
Channel: Local/d2450c9eb93499608f29d1e2e96f4a2f@adhearsion-originate-00000002;1
Command: EXEC Bridge "Local/d2450c9eb93499608f29d1e2e96f4a2f@adhearsion-originate-00000002;1,F(adhearsion-redirect,1,1)"
CommandID: c95392dc-d23d-448e-8867-bd494c1a9b83


[2016-12-15 09:39:37.776] TRACE Adhearsion::Rayo::Connection::Asterisk: [RECV] Response: Error
ActionID: a9f31819-11f6-4bb3-b6f2-d7428006afa2
Message: Channel Local/d2450c9eb93499608f29d1e2e96f4a2f@adhearsion-originate-00000002;1 does not exist.
 

--
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: SIP_URI_OPTIONS

Ben Langfeld
Again using Adhearsion-Asterisk. Should be in the docs.

Enviado do meu iPhone

Em 15 de dez de 2016, às 08:30, Andrius Kairiukstis <[hidden email]> escreveu:


On Monday, 12 December 2016 23:40:17 UTC+1, Ben Langfeld wrote:
You can set channel variables and invoke Dial() using Adhearsion-asterisk. Other than that, no.

Hello,

I made an concept with originate and Local channel in asterisk and it would work, but there is small bug in Adhearsion, related to the Local channel

Shortly, when Asterisk dial to the local channel, after bridge, another call leg will be created and it should be tracked, or something like this happen (below)

Channel Local/d2450c9eb93499608f29d1e2e96f4a2f@adhearsion-originate-00000002;1 but at the moment, Local/d2450c9eb93499608f29d1e2e96f4a2f@adhearsion-originate-00000002;2 should be tracked.

I will try to work on this and get it solved.

By now Ben, maybe you could help with this question:

How I can invoke AMI originate within Adhearsion without using originate command?
I just want to send AMI action, same way as it's made in lib/adhearsion/translator/asterisk/call.rb.

I have tried this from adhearsion CLI, but something is missing:
originate_action = Adhearsion::Rayo::Component::Asterisk::AMI::Action.new :name => 'Originate', :params => {:async=>true, :context=>"default", :exten=>"1", :priority=>"1", :channel=>"SIP/aaa", :callerid => "12345", :timeout => 30000}
originate_action.request!

Regards,
Andrius

[2016-12-15 09:39:37.774] DEBUG Adhearsion::OutboundCall: f559727e-7217-4628-b73e-e64d4f1d39c2@: Executing command #<Adhearsion::Rayo::Command::Join target_call_id=nil, target_mix
er_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Thu, 15 Dec 2016 09:39:37 +0000, request_id="7ca5aec6-ca2a-47be-add5-de2522e1a3e9", call_uri="f
559727e-7217-4628-b73e-e64d4f1d39c2", mixer_name=nil, direction=nil, media=nil>
[2016-12-15 09:39:37.776] TRACE Adhearsion::Rayo::Connection::Asterisk: [SEND] Action: agi
ActionID: a9f31819-11f6-4bb3-b6f2-d7428006afa2
Channel: Local/d2450c9eb93499608f29d1e2e96f4a2f@adhearsion-originate-00000002;1
Command: EXEC Bridge "Local/d2450c9eb93499608f29d1e2e96f4a2f@adhearsion-originate-00000002;1,F(adhearsion-redirect,1,1)"
CommandID: c95392dc-d23d-448e-8867-bd494c1a9b83


[2016-12-15 09:39:37.776] TRACE Adhearsion::Rayo::Connection::Asterisk: [RECV] Response: Error
ActionID: a9f31819-11f6-4bb3-b6f2-d7428006afa2
Message: Channel Local/d2450c9eb93499608f29d1e2e96f4a2f@adhearsion-originate-00000002;1 does not exist.
 

--
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: SIP_URI_OPTIONS

Andrius Kairiukstis-2
Oh, thank you. I have to sleep more :) Forgot about adhearsion-asterisk

On Thursday, 15 December 2016 13:01:59 UTC+1, Ben Langfeld wrote:
Again using Adhearsion-Asterisk. Should be in the docs.

--
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: SIP_URI_OPTIONS

Andrius Kairiukstis-2
Quick update. I did it. Originate through local channel

Shortly:

CallRegistry – here I do store calls data to share;
Controller InvokeOriginate sending AMI originate;
OriginateController receiving inbound call from Local channel and dialing out destinations specified in CallRegistry for this leg of call. All necessary SIP URI OPTIONS, headers for Kamailio will be sent here as expected;
events.rb have process on Bridge event and it bridge call answered by destination resource, invoked by OriginateController – and with caller (InvokeOriginate).

There is issues with Local channel in asterisk so also I have to kill them (another AMI action) and cleanup Adhearsion.active_calls (by sending hangup).

Will share this code later

--
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.