Re: [asterisk-users] Asterisk as UAC: How to put call OnHold
Thanks for your hint, but unfortunately this does not result in the behaviour I am looking for. When I start "MusicOnHold" Asterisk streams the OnHold music itself, even if I specifiy an invalid MoH class or one without files. What I was looking for is a way to send a re-INVITE to its upstream SIP provider to inform it that the call should be placed on hold, exactly as described in the example in Section 2.1 of RFC 5359 (http://tools.ietf.org/html/rfc5359#section-2.1). Does anyone know how to do this from Asterisk dialplan? Any ideas are appreciated! :-) Greetings from a snowy Vienna, John :-) 2012/1/16 Johannes Zweng : > Ok, I will try this and let you know! > > Kind regards, > John > > > > 2012/1/16 Sammy Govind : >> Hey, >> I have never worried about looking at the SIP re-invites or anything when we >> engage MoH() application in asterisk. You can do a quick test on your test >> machine for this. >> >> Regards, >> Sammy >> >> On Mon, Jan 16, 2012 at 2:57 PM, Johannes Zweng wrote: >>> >>> Hi! >>> >>> Many thanks for this hint. I will try this! :-) >>> >>> A quick question: when doing this with "MusicOnHold()": will the SIP >>> server be aware that the call is placed onHold (i.e. will Asterisk >>> send the mentioned re-INVITE)? >>> >>> The point is - if possible - we want the caller to hear the OnHold >>> Music from the SIP server. If not we would have to copy the MoH to our >>> Asterisk (and change it on our side too, when it changes at the >>> SIP-server). >>> >>> >>> Kind regards, >>> John >>> >>> >>> >>> 2012/1/16 Sammy Govind >>> > >>> > Hi, >>> > >>> > yes, please see MusicOnHold() Application. You can call this app in your >>> > dialplan. This however will use the default music class and the >>> > corresponding music files placed in the asterisk server. If you don't want >>> > to stream music from Asterisk server side, try creating a new MusiconHold >>> > Class without any proper directory. That way Asterisk would only complain >>> > that there is no file to be streamed. >>> > >>> > Regards, >>> > Sammy >>> > >>> > On Sat, Jan 14, 2012 at 6:25 AM, Johannes Zweng >>> > wrote: >>> >> >>> >> Hi! >>> >> >>> >> Maybe I am missing something or am a little blind at the moment, but I >>> >> didn't find out how asterisk can place a call on hold when acting as user >>> >> agent client to another SIP server. >>> >> >>> >> Scenario: >>> >> -- >>> >> Asterisk registers to another SIP server (provider) as user agent. >>> >> An inbound call from this other SIP server comes in and arrives at >>> >> asterisk. >>> >> Asterisk performs some actions in the dialplan and should place the >>> >> call on hold after some time, so that the caller only hears the on hold >>> >> music from my provider (not streamed by my Asterisk). >>> >> >>> >> Technically speaking I want asterisk to send a re-INVITE >>> >> message containing an updated SDP body with the attribute "a=sendonly" or >>> >> "a=inactive" added so that the SIP server of my provider (where Asterisk >>> >> is >>> >> registered to as user) will recognize that the call should be placed on >>> >> hold. >>> >> >>> >> >>> >> A good example of what I want to achieve is presented in Section 2.1 of >>> >> RFC 5359 (Session Initiation Protocol Service Examples) >>> >> (http://tools.ietf.org/html/rfc5359#section-2.1) where "Bob" would be my >>> >> Asterisk (as UAC), "Alice" is the external caller and "Proxy" is the >>> >> provider's SIP server. >>> >> >>> >> >>> >> Question: >>> >> -- >>> >> Is there any way to perform this from the dialplan or by means of the >>> >> manager API? Is there an application like "Hold"? >>> >> >>> >> >>> >> Kind regards and greetings from Austria, >>> >> John :-) >>> >> >>> >>> -- >>> _ >>> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >>> New to Asterisk? Join us for a live introductory webinar every Thurs: >>> http://www.asterisk.org/hello >>> >>> asterisk-users mailing list >>> To UNSUBSCRIBE or update options visit: >>> http://lists.digium.com/mailman/listinfo/asterisk-users >> >> >> >> -- >> _ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> New to Asterisk? Join us for a live introductory webinar every Thurs: >> http://www.asterisk.org/hello >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Asterisk as UAC: How to put call OnHold
Ok, I will try this and let you know! Kind regards, John 2012/1/16 Sammy Govind : > Hey, > I have never worried about looking at the SIP re-invites or anything when we > engage MoH() application in asterisk. You can do a quick test on your test > machine for this. > > Regards, > Sammy > > On Mon, Jan 16, 2012 at 2:57 PM, Johannes Zweng wrote: >> >> Hi! >> >> Many thanks for this hint. I will try this! :-) >> >> A quick question: when doing this with "MusicOnHold()": will the SIP >> server be aware that the call is placed onHold (i.e. will Asterisk >> send the mentioned re-INVITE)? >> >> The point is - if possible - we want the caller to hear the OnHold >> Music from the SIP server. If not we would have to copy the MoH to our >> Asterisk (and change it on our side too, when it changes at the >> SIP-server). >> >> >> Kind regards, >> John >> >> >> >> 2012/1/16 Sammy Govind >> > >> > Hi, >> > >> > yes, please see MusicOnHold() Application. You can call this app in your >> > dialplan. This however will use the default music class and the >> > corresponding music files placed in the asterisk server. If you don't want >> > to stream music from Asterisk server side, try creating a new MusiconHold >> > Class without any proper directory. That way Asterisk would only complain >> > that there is no file to be streamed. >> > >> > Regards, >> > Sammy >> > >> > On Sat, Jan 14, 2012 at 6:25 AM, Johannes Zweng >> > wrote: >> >> >> >> Hi! >> >> >> >> Maybe I am missing something or am a little blind at the moment, but I >> >> didn't find out how asterisk can place a call on hold when acting as user >> >> agent client to another SIP server. >> >> >> >> Scenario: >> >> -- >> >> Asterisk registers to another SIP server (provider) as user agent. >> >> An inbound call from this other SIP server comes in and arrives at >> >> asterisk. >> >> Asterisk performs some actions in the dialplan and should place the >> >> call on hold after some time, so that the caller only hears the on hold >> >> music from my provider (not streamed by my Asterisk). >> >> >> >> Technically speaking I want asterisk to send a re-INVITE >> >> message containing an updated SDP body with the attribute "a=sendonly" or >> >> "a=inactive" added so that the SIP server of my provider (where Asterisk >> >> is >> >> registered to as user) will recognize that the call should be placed on >> >> hold. >> >> >> >> >> >> A good example of what I want to achieve is presented in Section 2.1 of >> >> RFC 5359 (Session Initiation Protocol Service Examples) >> >> (http://tools.ietf.org/html/rfc5359#section-2.1) where "Bob" would be my >> >> Asterisk (as UAC), "Alice" is the external caller and "Proxy" is the >> >> provider's SIP server. >> >> >> >> >> >> Question: >> >> -- >> >> Is there any way to perform this from the dialplan or by means of the >> >> manager API? Is there an application like "Hold"? >> >> >> >> >> >> Kind regards and greetings from Austria, >> >> John :-) >> >> >> >> -- >> _ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> New to Asterisk? Join us for a live introductory webinar every Thurs: >> http://www.asterisk.org/hello >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users > > > > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Asterisk as UAC: How to put call OnHold
Hi! Many thanks for this hint. I will try this! :-) A quick question: when doing this with "MusicOnHold()": will the SIP server be aware that the call is placed onHold (i.e. will Asterisk send the mentioned re-INVITE)? The point is - if possible - we want the caller to hear the OnHold Music from the SIP server. If not we would have to copy the MoH to our Asterisk (and change it on our side too, when it changes at the SIP-server). Kind regards, John 2012/1/16 Sammy Govind > > Hi, > > yes, please see MusicOnHold() Application. You can call this app in your > dialplan. This however will use the default music class and the corresponding > music files placed in the asterisk server. If you don't want to stream music > from Asterisk server side, try creating a new MusiconHold Class without any > proper directory. That way Asterisk would only complain that there is no file > to be streamed. > > Regards, > Sammy > > On Sat, Jan 14, 2012 at 6:25 AM, Johannes Zweng wrote: >> >> Hi! >> >> Maybe I am missing something or am a little blind at the moment, but I >> didn't find out how asterisk can place a call on hold when acting as user >> agent client to another SIP server. >> >> Scenario: >> -- >> Asterisk registers to another SIP server (provider) as user agent. >> An inbound call from this other SIP server comes in and arrives at asterisk. >> Asterisk performs some actions in the dialplan and should place the call on >> hold after some time, so that the caller only hears the on hold music from >> my provider (not streamed by my Asterisk). >> >> Technically speaking I want asterisk to send a re-INVITE message containing >> an updated SDP body with the attribute "a=sendonly" or "a=inactive" added so >> that the SIP server of my provider (where Asterisk is registered to as user) >> will recognize that the call should be placed on hold. >> >> >> A good example of what I want to achieve is presented in Section 2.1 of RFC >> 5359 (Session Initiation Protocol Service Examples) >> (http://tools.ietf.org/html/rfc5359#section-2.1) where "Bob" would be my >> Asterisk (as UAC), "Alice" is the external caller and "Proxy" is the >> provider's SIP server. >> >> >> Question: >> -- >> Is there any way to perform this from the dialplan or by means of the >> manager API? Is there an application like "Hold"? >> >> >> Kind regards and greetings from Austria, >> John :-) >> -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Asterisk as UAC: How to put call OnHold
Hi! Maybe I am missing something or am a little blind at the moment, but I didn't find out how asterisk can place a call on hold when acting as user agent client to another SIP server. Scenario: -- Asterisk registers to another SIP server (provider) as user agent. An inbound call from this other SIP server comes in and arrives at asterisk. Asterisk performs some actions in the dialplan and should place the call on hold after some time, so that the caller only hears the on hold music from my provider (not streamed by my Asterisk). Technically speaking I want asterisk to send a re-INVITE message containing an updated SDP body with the attribute "a=sendonly" or "a=inactive" added so that the SIP server of my provider (where Asterisk is registered to as user) will recognize that the call should be placed on hold. A good example of what I want to achieve is presented in Section 2.1 of RFC 5359 (Session Initiation Protocol Service Examples) ( http://tools.ietf.org/html/rfc5359#section-2.1) where "Bob" would be my Asterisk (as UAC), "Alice" is the external caller and "Proxy" is the provider's SIP server. Question: -- Is there any way to perform this from the dialplan or by means of the manager API? Is there an application like "Hold"? Kind regards and greetings from Austria, John :-) -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
RE: [asterisk-users] wrong billsec, when using dial-flag M (was:Answering machine detection after Dial())
Summarizing my previous problem: I had troubles to execute dialplan commands (for example: AMD) on the called party call-leg after issuing a Dial(). Today I played around with the Dial-flag M(), which allows to execute macros on the called party call-leg, before the link (bridging) takes place and I am facing a new problem: I am executing AMD() in a macro on the called party, after the called party answers and before the link takes place. As you may know, AMD() needs some time (can be a few seconds) before it's finished. Asterisk waits until the macro is finished and then links (bridges) the two call legs together. Everything ok until here. But when analyzing my logs and the CDR, I found out that "billsec" contained only the time from the "Link" Event until the "Unlink" event (hangup) and not the time while the dial-Macro was running, altough the outgoing call is already answered and therefore costing money while the macro (AMD) is running! Here my Dial command: Dial(SIP/[EMAIL PROTECTED],300,m(silence)M(testAmdMacro)); And here the macro: macro testAmdMacro () { Verbose(0,Starting macro testAmdMacro.); AMD(); Verbose(0,AMD finished. result: ${AMDSTATUS}); }; Has anybody an idea if I make something wrong, or is this the intended behaviour? Best regards, john > -Original Message- > From: [EMAIL PROTECTED] [mailto:asterisk- > [EMAIL PROTECTED] On Behalf Of Johannes Zweng > Sent: Tuesday, June 12, 2007 8:50 PM > To: asterisk-users@lists.digium.com > Subject: [asterisk-users] Answering machine detection after Dial() > > Hi people! > > Sorry for bringing up some annoying issue.. yes, it's AMD again... > > But I was searching the last days for a solution for my problem and > didn't really find anything. Now I'm hoping that someone of you has > maybe an idea for me. :) > > > My setup: > - > I use the Asterik Manager API to generate outgoing calls (by using > "Originate" messages). > > These outgoing calls are placed to a SIP IVR-Server (dialog system > with speech recognition) and are then connected out to real-world > users via the dialplan using "Dial()" (see context below). > > (The reason why the first call-leg goes to the voice-server and not > to > the user is for reliability reasons. I don't want to annoy users > with > calls which cannot be established, when the voice-server is down for > example.) > > > My problem: > --- > Somehow I should be able to detect, if an answering machine answers > on > the second outgoing call leg (caused by the Dial(), going out to the > real-life person) and I should somehow be able to inform the > voice-server about this fact. > > > My naive first idea: > > I thought I could use the dialplan application AMD() and if it > detects > an answering machine, I could play a pre-defined text, or > DTMF-sequence, which in fact will be recognized by the voice-server > which should interrupt its "human" dialog and restart with the > "machine" dialog. > > BUT: I found out that my AMD() command in the dialplan after the > Dial() never gets executed. :( As far as I understood, it's not > possible to execute further commands after the Dial(). (Maybe I'm > wrong. Please correct me, if so..). > > > > Hmm.. And here I'm stuck. Has anybody some idea for me where I can > start looking for further solutions? Any help would be appreciated!! > :) > > > Thanks in advance!!! > > Best regards and greetings from Austria! > johnny > > > > P.S.: > > Some detail infos: > > I'm using Asterisk 1.2.9.1. > > I installed app_amd from > http://www.freedomphones.net/files/app_amd2.c > > My dialplan context for generating the outgoing calls looks like > this > (I use AEL): > > > context 1000_amd_tests { > > _0043[1-9]. => { > // be verbose.. :) > Verbose(0,InfoInfo ${CONTEXT} - ${EXTEN} called on > ${CHANNEL}.); > > // set our callerId to the correct id > Set(CALLERID(number)=xx); > > // absolute call timeout > Set(TIMEOUT(absolute)=3600; > > // debug > Verbose(0,DebugDebug Will execute Dial on ${CHANNEL}.); > > // now dial to reallife user, timeout 300 because, we will > abort > // via manager API if we decide it takes too long > Dial(Zap/r1/${EXTEN:4,0},300); > > // debug > Verbose(0,DebugDebug we are now after Dial on ${CHANNEL}.); > > // try AMD (configured through amd.conf) > AMD(); > > // debug > Verbose(0,DebugDebug A
[asterisk-users] Answering machine detection after Dial()
Hi people! Sorry for bringing up some annoying issue.. yes, it's AMD again... But I was searching the last days for a solution for my problem and didn't really find anything. Now I'm hoping that someone of you has maybe an idea for me. :) My setup: - I use the Asterik Manager API to generate outgoing calls (by using "Originate" messages). These outgoing calls are placed to a SIP IVR-Server (dialog system with speech recognition) and are then connected out to real-world users via the dialplan using "Dial()" (see context below). (The reason why the first call-leg goes to the voice-server and not to the user is for reliability reasons. I don't want to annoy users with calls which cannot be established, when the voice-server is down for example.) My problem: --- Somehow I should be able to detect, if an answering machine answers on the second outgoing call leg (caused by the Dial(), going out to the real-life person) and I should somehow be able to inform the voice-server about this fact. My naive first idea: I thought I could use the dialplan application AMD() and if it detects an answering machine, I could play a pre-defined text, or DTMF-sequence, which in fact will be recognized by the voice-server which should interrupt its "human" dialog and restart with the "machine" dialog. BUT: I found out that my AMD() command in the dialplan after the Dial() never gets executed. :( As far as I understood, it's not possible to execute further commands after the Dial(). (Maybe I'm wrong. Please correct me, if so..). Hmm.. And here I'm stuck. Has anybody some idea for me where I can start looking for further solutions? Any help would be appreciated!! :) Thanks in advance!!! Best regards and greetings from Austria! johnny P.S.: Some detail infos: I'm using Asterisk 1.2.9.1. I installed app_amd from http://www.freedomphones.net/files/app_amd2.c My dialplan context for generating the outgoing calls looks like this (I use AEL): context 1000_amd_tests { _0043[1-9]. => { // be verbose.. :) Verbose(0,InfoInfo ${CONTEXT} - ${EXTEN} called on ${CHANNEL}.); // set our callerId to the correct id Set(CALLERID(number)=xx); // absolute call timeout Set(TIMEOUT(absolute)=3600; // debug Verbose(0,DebugDebug Will execute Dial on ${CHANNEL}.); // now dial to reallife user, timeout 300 because, we will abort // via manager API if we decide it takes too long Dial(Zap/r1/${EXTEN:4,0},300); // debug Verbose(0,DebugDebug we are now after Dial on ${CHANNEL}.); // try AMD (configured through amd.conf) AMD(); // debug Verbose(0,DebugDebug AMD ${AMDSTATUS} - ${AMDCAUSE}.); Hangup(); }; T => { Verbose(0,WARN timeout - ${CONTEXT} ${EXTEN} on ${CHANNEL}.); Hangup(); }; }; An exmplaric Originate message for generating a call looks like this: action: Originate actionid: 25326212_156#20070531_193654_987_0043650xxx timeout: 15000 exten: 0043650xxx account: 8594 async: true callerid: 6437 context: 1000_amd_tests priority: 1 channel: SIP/[EMAIL PROTECTED] Note: "callerid" is what the voice-server sees, not the real-life person. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Associate manager events to a previous Originate action
Stefan Reuter wrote: >add an ActionId property to your Originate action and you will receive >the same ActionId as part of the OriginateSuccess or OriginateFailure >event. The OriginateSuccess event also contains a link to the channel so >you can relate them after you received the OriginateSuccess event. >For the OriginateSuccess/-Failure events to be sent you must also set >Async to true when sending the Originate action. Thank you very much! This did the trick! I can associate the first channel to my Originate action by reading the Uniqueid field of the OriginateSucess event and I also can associate the second channel (created by the Dial() command) to the first one by reading the fields of the Dial event. This was exactly the hint I needed. Thanks! :-) Best regards, John ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Associate manager events to a previous Originate action
Hi people! I am writing an application that makes heavy use of the manager API to create outbound calls, but I am still learning a lot... :-) At the moment I am thinking about one problem. Let me describe it: - I send an Originate action with extension- and context-parameter to the manager API of * - in the specified extension I have a Dial() command which links the first channel (generated by my Originate command) to a second call - some time later, after sending the Originate I receive a bunch of events, some of them for the first created channel (by the originate), some of them for the channel which was created by the Dial() and some events for completely uninvolved channels.. Although I can associate every incoming event to a specific channel on Asterisk (because of the Uniqueid field) I see no possibility to identify without doubts which channels were created as a result of my Originate action. But I need to monitor the events for these channels because my program needs to be aware about the calls' states. Did someone of you already run into the same problem or has some hint for me? Any help would be appreciated! Thanx! :-) Best regards, John ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users