irontec / ivozprovider

IVOZ Provider - Multitenant solution for VoIP telephony providers
https://ivoz.irontec.com/
GNU General Public License v3.0
195 stars 79 forks source link

oasis: call ends on voicemail unexpectedly #782

Closed manfer closed 5 years ago

manfer commented 5 years ago

I have a PBX (ivozprovider company) with a friend and users. It has a DDI routed to the friend. The friend (a PBX outside ivozprovider) is configured to hangup the call, 603 declined.

I call the DDI from outside, example from a mobile, the call hangs correctly.

I call the DDI from one of the users on same PBX (ivozprovider company) and the call hangs correctly.

I call the DDI from an user from another PBX (ivozprovider company) on same ivozprovider and the call bounces correctly and hangs.

I call the DDI from a retail on same ivozprovider and the call bounces but ends on a voicemail that finishes sended to my mail. I have no clue how this is happening. I can't see the forward to the voicemail in asterisk console. Don't know either why it choose to send it to my mail. Any idea how to debug this?

Kaian commented 5 years ago

Hi @manfer!

No clue at all, I should have to setup this scenario to test it. Can you provide the full asterisk console log to see the actual flow?

Maybe there is a case without break somewhere in the code 0:-)

Regards

manfer commented 5 years ago
  == Setting global variable 'SIPDOMAIN' to 'xxxxx.example.domain'
       > [b1][ada55f59] Executing [bbbbbbbbb@retail:1] NoOp("PJSIP/b1c28r3_aretail-0001e3c8", "Outgoing call from retail account "" <aaaaaaaaa> to bbbbbbbbb") in new stack
       > [b1][ada55f59] Executing [bbbbbbbbb@retail:2] AGI("PJSIP/b1c28r3_aretail-0001e3c8", "agi://127.0.0.1:4573/cli.php?model=default/calls/retail") in new stack
       > [b1][ada55f59] [CallsController.php:447  ] AGI SetVar("PJSIP/b1c28r3_aretail-0001e3c8", "__COMPANYID = 28")
       > [b1][ada55f59] [CallsController.php:448  ] AGI SetVar("PJSIP/b1c28r3_aretail-0001e3c8", "CHANNEL(language) = es")
       > [b1][ada55f59] [CallsController.php:454  ] AGI SetVar("PJSIP/b1c28r3_aretail-0001e3c8", "_CALL_ID = rF6S2DzkKgphZ2Ds3zH3PQ..")
       > [b1][ada55f59] [CallsController.php:690  ] AGI SetVar("PJSIP/b1c28r3_aretail-0001e3c8", "CALLER_TYPE = RETAIL")
       > [b1][ada55f59] [CallsController.php:691  ] AGI SetVar("PJSIP/b1c28r3_aretail-0001e3c8", "CALLER_ID = 3")
       > [b1][ada55f59] [CallsController.php:481  ] AGI Notice("PJSIP/b1c28r3_aretail-0001e3c8", "Processing outgoing call from Retail account aretail [retail3] to number bbbbbbbbb")
       > [b1][ada55f59] [ExternalRetailCallActi:61] AGI Notice("PJSIP/b1c28r3_aretail-0001e3c8", "Retail account aretail [retail3] presented origin matches account DDI 34aaaaaaaaa [ddi109].")
       > [b1][ada55f59] [ExternalRetailCallActi:63] AGI SetVar("PJSIP/b1c28r3_aretail-0001e3c8", "CALLERID(num) = 34aaaaaaaaa")
       > [b1][ada55f59] [ExternalCallAction.php:67] AGI Verbos("PJSIP/b1c28r3_aretail-0001e3c8", "Using Pricing Plan My Plan [pricingPlan4]")
       > [b1][ada55f59] [ExternalCallAction:127   ] AGI Notice("PJSIP/b1c28r3_aretail-0001e3c8", "DDI 34bbbbbbbbb belongs to us, request bounce back this call")
       > [b1][ada55f59] [ExternalCallAction:128   ] AGI SetVar("PJSIP/b1c28r3_aretail-0001e3c8", "_BOUNCEME = yes")
       > [b1][ada55f59] [ExternalRetailCallAct:102] AGI SetVar("PJSIP/b1c28r3_aretail-0001e3c8", "DIAL_DST = PJSIP/34bbbbbbbbb@proxytrunks")
       > [b1][ada55f59] [ExternalRetailCallAct:103] AGI SetVar("PJSIP/b1c28r3_aretail-0001e3c8", "DIAL_OPTS = ")
       > [b1][ada55f59] [ExternalRetailCallAct:104] AGI SetVar("PJSIP/b1c28r3_aretail-0001e3c8", "DIAL_TIMEOUT = ")
    -- AGI Script Executing Application: (Goto) Options: (call-world,34bbbbbbbbb,1)
    -- Goto (call-world,34bbbbbbbbb,1)
    -- <PJSIP/b1c28r3_aretail-0001e3c8>AGI Script agi://127.0.0.1:4573/cli.php?model=default/calls/retail completed, returning 0
       > [b1][ada55f59] Executing [34bbbbbbbbb@call-world:1] NoOp("PJSIP/b1c28r3_aretail-0001e3c8", "Calling external number") in new stack
       > [b1][ada55f59] Executing [34bbbbbbbbb@call-world:2] Dial("PJSIP/b1c28r3_aretail-0001e3c8", "PJSIP/34bbbbbbbbb@proxytrunks,,b(add-headers^34bbbbbbbbb^1)") in new stack
    -- PJSIP/proxytrunks-0001e3c9 Internal Gosub(add-headers,34bbbbbbbbb,1) start
       > [b1][ada55f59] Executing [34bbbbbbbbb@add-headers:1] NoOp("PJSIP/proxytrunks-0001e3c9", "Adding Headers before placing call") in new stack
       > [b1][ada55f59] Executing [34bbbbbbbbb@add-headers:2] AGI("PJSIP/proxytrunks-0001e3c9", "agi://127.0.0.1:4573/cli.php?model=default/calls/addheaders") in new stack
       > [b1][ada55f59] [CallsController.php:600  ] AGI SetVar("PJSIP/proxytrunks-0001e3c9", "PJSIP_HEADER(add,X-Call-Id) = rF6S2DzkKgphZ2Ds3zH3PQ..")
       > [b1][ada55f59] [CallsController.php:601  ] AGI SetVar("PJSIP/proxytrunks-0001e3c9", "PJSIP_HEADER(add,X-Info-BrandId) = 1")
       > [b1][ada55f59] [CallsController.php:602  ] AGI SetVar("PJSIP/proxytrunks-0001e3c9", "PJSIP_HEADER(add,X-Info-CompanyId) = 28")
       > [b1][ada55f59] [CallsController.php:603  ] AGI SetVar("PJSIP/proxytrunks-0001e3c9", "PJSIP_HEADER(add,X-Info-CompanyName) = RetailCompany")
       > [b1][ada55f59] [CallsController.php:604  ] AGI SetVar("PJSIP/proxytrunks-0001e3c9", "PJSIP_HEADER(add,X-Info-MediaRelaySet) = 0")
       > [b1][ada55f59] [CallsController.php:637  ] AGI SetVar("PJSIP/proxytrunks-0001e3c9", "PJSIP_HEADER(add,X-Info-CompanyDomain) = xxxxx.example.domain")
       > [b1][ada55f59] [CallsController.php:657  ] AGI SetVar("PJSIP/proxytrunks-0001e3c9", "PJSIP_HEADER(add,X-Info-BounceMe) = yes")
    -- <PJSIP/proxytrunks-0001e3c9>AGI Script agi://127.0.0.1:4573/cli.php?model=default/calls/addheaders completed, returning 0
       > [b1][ada55f59] Executing [34bbbbbbbbb@add-headers:3] Return("PJSIP/proxytrunks-0001e3c9", "") in new stack
  == Spawn extension (trunks, 34bbbbbbbbb, 1) exited non-zero on 'PJSIP/proxytrunks-0001e3c9'
    -- PJSIP/proxytrunks-0001e3c9 Internal Gosub(add-headers,34bbbbbbbbb,1) complete GOSUB_RETVAL=
    -- Called PJSIP/34bbbbbbbbb@proxytrunks
  == Setting global variable 'SIPDOMAIN' to 'a.provider.domain'
       > [b1][bb2ef560] Executing [bounce@trunks:1] NoOp("PJSIP/proxytrunks-0001e3ca", "Intra Oasis bounced call") in new stack
       > [b1][bb2ef560] Executing [bounce@trunks:2] Set("PJSIP/proxytrunks-0001e3ca", "DEST=34bbbbbbbbb") in new stack
       > [b1][bb2ef560] Executing [bounce@trunks:3] Dial("PJSIP/proxytrunks-0001e3ca", "PJSIP/34bbbbbbbbb@proxybouncer,,b(bounce-headers^34bbbbbbbbb^1)") in new stack
    -- PJSIP/proxybouncer-0001e3cb Internal Gosub(bounce-headers,34bbbbbbbbb,1) start
       > [b1][bb2ef560] Executing [34bbbbbbbbb@bounce-headers:1] NoOp("PJSIP/proxybouncer-0001e3cb", "Adding Bounced headers") in new stack
       > [b1][bb2ef560] Executing [34bbbbbbbbb@bounce-headers:2] Set("PJSIP/proxybouncer-0001e3cb", "PJSIP_HEADER(add,"X-Info-Bounced")=yes") in new stack
       > [b1][bb2ef560] Executing [34bbbbbbbbb@bounce-headers:3] Return("PJSIP/proxybouncer-0001e3cb", "") in new stack
  == Spawn extension (default, bounce, 1) exited non-zero on 'PJSIP/proxybouncer-0001e3cb'
    -- PJSIP/proxybouncer-0001e3cb Internal Gosub(bounce-headers,34bbbbbbbbb,1) complete GOSUB_RETVAL=
    -- Called PJSIP/34bbbbbbbbb@proxybouncer
  == Setting global variable 'SIPDOMAIN' to 'trunks.ivozprovider.local'
       > [b1][e0559f27] Executing [34bbbbbbbbb@trunks:1] NoOp("PJSIP/proxytrunks-0001e3cc", "Incoming external call from "" <34aaaaaaaaa> to 34bbbbbbbbb") in new stack
       > [b1][e0559f27] Executing [34bbbbbbbbb@trunks:2] AGI("PJSIP/proxytrunks-0001e3cc", "agi://127.0.0.1:4573/cli.php?model=default/calls/trunks") in new stack
       > [b1][e0559f27] [CallsController.php:53   ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "CALLERID(ANI-num) = 34aaaaaaaaa")
       > [b1][e0559f27] [CallsController.php:56   ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "__CALL_TYPE = external")
       > [b1][e0559f27] [CallsController.php:64   ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "__CALL_ID = ab72f65b-b301-4a61-a68d-3bf16f0cf687")
       > [b1][e0559f27] [CallsController.php:68   ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "__COMPANYID = 1")
       > [b1][e0559f27] [CallsController.php:69   ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "CHANNEL(musicclass) = default")
       > [b1][e0559f27] [CallsController.php:70   ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "CHANNEL(language) = es")
       > [b1][e0559f27] [Wrapper.php:358          ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "_CALLER_TYPE = DDI")
       > [b1][e0559f27] [Wrapper.php:359          ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "_CALLER_ID = 129")
       > [b1][e0559f27] [DDIAction.php:28         ] AGI Notice("PJSIP/proxytrunks-0001e3cc", "Processing DDI with number bbbbbbbbb [ddi129]")
       > [b1][e0559f27] [DDIAction.php:83         ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "CALLERID(name) = ")
       > [b1][e0559f27] [RouterAction.php:71      ] AGI Verbos("PJSIP/proxytrunks-0001e3cc", "DDIAction -> friend")
       > [b1][e0559f27] [FriendCallAction.php:45  ] AGI Notice("PJSIP/proxytrunks-0001e3cc", "Preparing call to bbbbbbbbb through friend friendname [friend27])")
       > [b1][e0559f27] [FriendCallAction.php:51  ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "CALLERID(num) = aaaaaaaaa")
       > [b1][e0559f27] [FriendCallAction.php:61  ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "DIAL_EXT = bbbbbbbbb")
       > [b1][e0559f27] [FriendCallAction.php:62  ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "DIAL_DST = PJSIP/b1c1f27_friendname")
       > [b1][e0559f27] [FriendCallAction.php:63  ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "__DIAL_ENDPOINT = b1c1f27_friendname")
       > [b1][e0559f27] [FriendCallAction.php:64  ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "DIAL_TIMEOUT = ")
       > [b1][e0559f27] [FriendCallAction.php:65  ] AGI SetVar("PJSIP/proxytrunks-0001e3cc", "DIAL_OPTS = ")
    -- AGI Script Executing Application: (Goto) Options: (call-friend,bbbbbbbbb,1)
    -- Goto (call-friend,bbbbbbbbb,1)
    -- <PJSIP/proxytrunks-0001e3cc>AGI Script agi://127.0.0.1:4573/cli.php?model=default/calls/trunks completed, returning 0
       > [b1][e0559f27] Executing [bbbbbbbbb@call-friend:1] NoOp("PJSIP/proxytrunks-0001e3cc", "Calling bbbbbbbbb through b1c1f27_friendname") in new stack
       > [b1][e0559f27] Executing [bbbbbbbbb@call-friend:2] Dial("PJSIP/proxytrunks-0001e3cc", "PJSIP/b1c1f27_friendname,,b(add-headers^bbbbbbbbb^1)") in new stack
    -- PJSIP/b1c1f27_friendname-0001e3cd Internal Gosub(add-headers,bbbbbbbbb,1) start
       > [b1][e0559f27] Executing [bbbbbbbbb@add-headers:1] NoOp("PJSIP/b1c1f27_friendname-0001e3cd", "Adding Headers before placing call") in new stack
       > [b1][e0559f27] Executing [bbbbbbbbb@add-headers:2] AGI("PJSIP/b1c1f27_friendname-0001e3cd", "agi://127.0.0.1:4573/cli.php?model=default/calls/addheaders") in new stack
       > [b1][e0559f27] [CallsController.php:600  ] AGI SetVar("PJSIP/b1c1f27_friendname-0001e3cd", "PJSIP_HEADER(add,X-Call-Id) = ab72f65b-b301-4a61-a68d-3bf16f0cf687")
       > [b1][e0559f27] [CallsController.php:601  ] AGI SetVar("PJSIP/b1c1f27_friendname-0001e3cd", "PJSIP_HEADER(add,X-Info-BrandId) = 1")
       > [b1][e0559f27] [CallsController.php:602  ] AGI SetVar("PJSIP/b1c1f27_friendname-0001e3cd", "PJSIP_HEADER(add,X-Info-CompanyId) = 1")
       > [b1][e0559f27] [CallsController.php:603  ] AGI SetVar("PJSIP/b1c1f27_friendname-0001e3cd", "PJSIP_HEADER(add,X-Info-CompanyName) = PBXCompany")
       > [b1][e0559f27] [CallsController.php:604  ] AGI SetVar("PJSIP/b1c1f27_friendname-0001e3cd", "PJSIP_HEADER(add,X-Info-MediaRelaySet) = 0")
       > [b1][e0559f27] [CallsController.php:618  ] AGI SetVar("PJSIP/b1c1f27_friendname-0001e3cd", "PJSIP_HEADER(add,X-Info-Callee) = bbbbbbbbb")
       > [b1][e0559f27] [CallsController.php:619  ] AGI SetVar("PJSIP/b1c1f27_friendname-0001e3cd", "PJSIP_HEADER(add,X-Info-Friend) = dynamic")
       > [b1][e0559f27] [CallsController.php:620  ] AGI SetVar("PJSIP/b1c1f27_friendname-0001e3cd", "PJSIP_HEADER(add,X-Info-UserMaxCalls) = 0")
    -- <PJSIP/b1c1f27_friendname-0001e3cd>AGI Script agi://127.0.0.1:4573/cli.php?model=default/calls/addheaders completed, returning 0
       > [b1][e0559f27] Executing [bbbbbbbbb@add-headers:3] Return("PJSIP/b1c1f27_friendname-0001e3cd", "") in new stack
  == Spawn extension (friends, bbbbbbbbb, 1) exited non-zero on 'PJSIP/b1c1f27_friendname-0001e3cd'
    -- PJSIP/b1c1f27_friendname-0001e3cd Internal Gosub(add-headers,bbbbbbbbb,1) complete GOSUB_RETVAL=
    -- Called PJSIP/b1c1f27_friendname
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Auto fallthrough, channel 'PJSIP/proxytrunks-0001e3cc' status is 'CHANUNAVAIL'
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Auto fallthrough, channel 'PJSIP/proxytrunks-0001e3ca' status is 'CHANUNAVAIL'
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Auto fallthrough, channel 'PJSIP/b1c28r3_aretail-0001e3c8' status is 'CHANUNAVAIL'
Kaian commented 5 years ago

I can't see a Voicemail execution in the whole dialplan :thinking:

Are you sure the Voicemail being played belongs to IvozProvider?

manfer commented 5 years ago

Yes. Because the mail that I receive comes from the configured mail data on brand and uses the ivozprovider mail template for voicemail.

I'm quite surprised too.

I'm going to look to sngrep in my failover oasis install just in case the call finishes there for some reason. Just as a last idea. Though makes no much sense to me the call finishing there. And I wouldn't expect it finishing on a voicemail either.

manfer commented 5 years ago

I'm going to look to sngrep in my failover oasis install just in case the call finishes there for some reason. Just as a last idea. Though makes no much sense to me the call finishing there. And I wouldn't expect it finishing on a voicemail either.

LOL. I don't even have to do that.

That's indeed what's happening. My provider is for sure sending the call to the failover after the call to the primary server is declined. I can be sure of this because the DDI on the failover is routed to a conditional route which is routed to a voicemail.

I didn't knew they will try the failover when they receive a reply. I thought my provider was only sending calls to my failover server when my primary server was not replying at all.

Sorry

Now what is strange is why it only happens when the call starts from a retail but not in all other cases.

Kaian commented 5 years ago

Glad to hear that.

This time.... problem was elsewhere (tm)!

manfer commented 5 years ago

That's indeed what's happening. My provider is for sure sending the call to the failover after the call to the primary server is declined. I can be sure of this because the DDI on the failover is routed to a conditional route which is routed to a voicemail.

Sorry again. This is not accurate. My provider is not involved in this call at the beggining because it is a bounced call. Somehow when the bounce fails the call ends on my failover when the call starts from a retail. This doesn't happen when the call starts from a user on other ivozprovider company even when it is bounced in that case too.

Now that I have a clue of what is happening I can investigate more in depth later.

Kaian commented 5 years ago

But from what I understand this no longer has relation with the issue title. Is more something like bounced calls are not declined in the same way or something like that?

Regards!

manfer commented 5 years ago

Somehow when the bounce fails the call ends on my failover

And that's it. The retail PBX (external PBX, no ivozprovider) has a failover route configured when the first route fails. Nothing to do with ivozprovider, other than my primary route is an ivozprovider install and the failover route is other ivozprovider install.

All working as expected.

manfer commented 5 years ago

But from what I understand this no longer has relation with the issue title. Is more something like bounced calls are not declined in the same way or something like that?

Not even that. Sorry, just my total fault not understanding the flow of the call.

This can be closed. Sorry again.

Kaian commented 5 years ago

No problem!