SIP_URI_OPTIONS

74 views
Skip to first unread message

Andrius Kairiukstis

unread,
Dec 12, 2016, 2:52:38 PM12/12/16
to Adhearsion
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:aaabbbc...@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:aaabbbc...@172.18.200.108:45727;someoption=somevalue>

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/aaabbb...@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:12...@172.21.0.68>;tag=as578e1210
To: <sip:aaabbb...@185.105.176.67;someoption=somevalue>

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

Regards,
Andrius


Ben Langfeld

unread,
Dec 12, 2016, 5:40:17 PM12/12/16
to adhea...@googlegroups.com
You can set channel variables and invoke Dial() using Adhearsion-asterisk. Other than that, no.

Enviado do meu iPhone
--
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 adhearsion+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrius Kairiukstis

unread,
Dec 15, 2016, 5:30:39 AM12/15/16
to Adhearsion

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.
 

Ben Langfeld

unread,
Dec 15, 2016, 7:01:59 AM12/15/16
to adhea...@googlegroups.com
Again using Adhearsion-Asterisk. Should be in the docs.

Enviado do meu iPhone
--

Andrius Kairiukstis

unread,
Dec 15, 2016, 7:06:18 AM12/15/16
to Adhearsion
Oh, thank you. I have to sleep more :) Forgot about adhearsion-asterisk

Andrius Kairiukstis

unread,
Dec 22, 2016, 6:20:35 AM12/22/16
to Adhearsion
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

Reply all
Reply to author
Forward
0 new messages