Manager api bridge call problem

Hi,

I am initiating an outgoing call using the manager API. I am trying to find out how I can call 2 outside numbers and bridge them together with manager api.

My originate command is as follows

Action: Originate
Channel: SIP/rapidvox/12222222222
Priority: 1
Context: long_distance
CallerId: 11111111111
WaitTime: 30
MaxRetry: 2

which works fine!

I tried concatenating two channels with an “&” like

Channel: SIP/rapidvox/12222222222&SIP/rapidvox/13333333333

but it fails saying “Invalid Number Format”

What am i missing here?

Thanks,

Vito

I think you need to let the dialplan take care of the 2nd leg of the call. Something like this may work.

Originate Request

Action: Originate
Channel: SIP/rapidvox/12222222222
Priority: 1
Context: long_distance
CallerId: 11111111111
WaitTime: 30 
Variable: secondLeg:13333333333

Dialplan

[long_distance]
exten => _1XXXXXXXXXX,1,Dial(SIP/rapidvox/${secondLeg})
exten => _1XXXXXXXXXX,n,Hangup()

Disclaimer, that is totally untested, it’s just a conceptual example.

Thanks for the reply but it didn’t work :frowning: now I get “Channel 'SIP/rapidvox/0822bc28 sent into invalid extension ‘s’ in context ‘default’, but no invalid number” error after the 1 number picks up the phone.

Well i had taken everything out from my extensions.conf except that long_distance part not to get too confused, that’s probably why it can’t find match for ‘s’ in [default] because there is no such context. But the problem is why does it even try to find [default] ‘s’ and not what we really passed into it?

I also tried something else and got closer to success, when i executed

Action: Originate
Channel: SIP/rapidvox/12222222222
Exten: 13333333333
Context: long_distance
Priority: 1
Callerid: 3125551212

This calls the first number (222-222-2222) then the second call gets “rejected” but i can see the events from the manager window passing thorough, it’s actually trying to initiate another call to the right number (333-333-3333) but it ends up dying with ‘Call Rejected’ :frowning:((

any more ideas?

Here is what’s going on in the events…

Action: Originate
Channel: SIP/rapidvox/12222222222
Exten: 13333333333
Context: long_distance
Priority: 1
Callerid: 3125551212

Response: Success
Message: Originate successfully queued

Event: Newchannel
Privilege: call,all
Channel: SIP/rapidvox-0822bc28
State: Down
CallerIDNum:
CallerIDName:
Uniqueid: 1221049661.18

Event: Newcallerid
Privilege: call,all
Channel: SIP/rapidvox-0822bc28
CallerID: 3125551212
CallerIDName:
Uniqueid: 1221049661.18
CID-CallingPres: 0 (Presentation Allowed, Not Screened)

Event: Newstate
Privilege: call,all
Channel: SIP/rapidvox-0822bc28
State: Up
CallerID: 3125551212
CallerIDName:
Uniqueid: 1221049661.18

Event: Newexten
Privilege: call,all
Channel: SIP/rapidvox-0822bc28
Context: long_distance
Extension: 13333333333
Priority: 1
Application: Set
AppData: CDR(userfield)=my information
Uniqueid: 1221049661.18

Event: Newexten
Privilege: call,all
Channel: SIP/rapidvox-0822bc28
Context: long_distance
Extension: 13333333333
Priority: 2
Application: Dial
AppData: SIP/rapidvox/13333333333
Uniqueid: 1221049661.18

Event: Newchannel
Privilege: call,all
Channel: SIP/rapidvox-082303e0
State: Down
CallerIDNum:
CallerIDName:
Uniqueid: 1221049670.19

Event: Dial
Privilege: call,all
Source: SIP/rapidvox-0822bc28
Destination: SIP/rapidvox-082303e0
CallerID: 3125551212
CallerIDName:
SrcUniqueID: 1221049661.18
DestUniqueID: 1221049670.19

Event: Newcallerid
Privilege: call,all
Channel: SIP/rapidvox-082303e0
CallerID: 13333333333
CallerIDName:
Uniqueid: 1221049670.19
CID-CallingPres: 0 (Presentation Allowed, Not Screened)

Event: Hangup
Privilege: call,all
Channel: SIP/rapidvox-082303e0
Uniqueid: 1221049670.19
Cause: 21
Cause-txt: Call Rejected

Event: Newexten
Privilege: call,all
Channel: SIP/rapidvox-0822bc28
Context: long_distance
Extension: 13333333333
Priority: 3
Application: Dial
AppData: SIP/rapidvox/13333333333
Uniqueid: 1221049661.18

Event: Newchannel
Privilege: call,all
Channel: SIP/rapidvox-08228f58
State: Down
CallerIDNum:
CallerIDName:
Uniqueid: 1221049670.20

Event: Dial
Privilege: call,all
Source: SIP/rapidvox-0822bc28
Destination: SIP/rapidvox-08228f58
CallerID: 3125551212
CallerIDName:
SrcUniqueID: 1221049661.18
DestUniqueID: 1221049670.20

Event: Newcallerid
Privilege: call,all
Channel: SIP/rapidvox-08228f58
CallerID: 13333333333
CallerIDName:
Uniqueid: 1221049670.20
CID-CallingPres: 0 (Presentation Allowed, Not Screened)

Event: Hangup
Privilege: call,all
Channel: SIP/rapidvox-08228f58
Uniqueid: 1221049670.20
Cause: 21
Cause-txt: Call Rejected

Event: Hangup
Privilege: call,all
Channel: SIP/rapidvox-0822bc28
Uniqueid: 1221049661.18
Cause: 21
Cause-txt: Call Rejected

i would need to see the relevant part of the dialplan to help you much more.

in regards to the “Call Rejected” message, can you turn on SIP debugging to see what is actually coming back? do you have more than one outbound ‘trunk’ with your VoIP provider?

dialplan is as this…

[long_distance]
exten => _1NXXNXXXXXX,n,Dial,SIP/rapidvox/${EXTEN}

just 1 simple line (besides the general configuration at the top), i am not trying to do anything fancy… just forward the call to the VoIP

looking at your AMI output, i would say everything is good except at the VoIP provider level. For some reason it appears they are rejecting the call. SIP debug logs should give a better indication of the real error being returned.

as you suggested… setting verbose to 4, this is what i get in the cli…

Channel SIP/rapidvox-08226800 was answered.
– Executing [13333333333@long_distance:1] Dial(“SIP/rapidvox-08226800”, “SIP/rapidvox/13333333333”) in new stack
– Called rapidvox/13333333333
– Got SIP response 603 “Declined” back from 64.21.13.41
– SIP/rapidvox-0822fa58 is busy
== Everyone is busy/congested at this time (1:1/0/0)
== Auto fallthrough, channel ‘SIP/rapidvox-08226800’ status is ‘BUSY’

I guess that’s a VoIP provider problem then…

i can only assume you replaced the real phone number with 3333333333, right? :smile:

oh my! did I ? :laughing: haha sure i did. Voip confirmed the problem because it was a test account they said, i will try again tonight and post the results… Might help someone else in the future who knows…

ok it’s working now, it was a problem with the VoIP provider. It works great!!!