add custom sip header before sending call to carrier

Discussions about development of VICIDIAL and astGUIclient

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

add custom sip header before sending call to carrier

Postby zeeshansajid » Sat Oct 29, 2011 2:27 pm

Hi Guys,

I need to send a couple of custom sip headers to my carrier for billing different customers on a single vicidial install. I know in asterisk we can add sip headers, but my question is if i can do it in an agi script if yes which one and how. I am sure somebody else must have implemented it but i could not find any post when i searched it on the forum. Any help is greatly appreciated. Thanks in advance.

Vici Rox
best regards,
Zeeshan Sajid
zeeshansajid
 
Posts: 15
Joined: Wed Sep 28, 2011 3:18 pm

Postby williamconley » Sat Oct 29, 2011 2:47 pm

adding sip headers is fairly easy. can be done in the "carrier" field under "dial plan". create a different carrier for each set of headers.

but how will you differentiate between when to send which header? is each client on a different campaign?

If so, you will just use a different dial prefix for each campaign, leading to a different "carrier" in vicidial, even though they all actually go to the SAME carrier when the leave "the box".

They can even all share a single "account entry" but with different "dial plan" settings, leaving the account entry blank on all but one carrier.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

RE add custom sip header before sending call to carrier

Postby zeeshansajid » Sun Oct 30, 2011 1:26 pm

Hi William,

Are you referring to the carrier settings section under admin settings, if yes i do see a dial plan entry and there we use the carrier's name to send the call out, but i am not sure if i have the campaign ID available there, so a better explanation would be greatly appreciated. Thanks

Zeeshan Sajid
zeeshansajid
 
Posts: 15
Joined: Wed Sep 28, 2011 3:18 pm

Postby zeeshansajid » Sun Oct 30, 2011 11:06 pm

Hi,

Here is what i have in mind, for all kinds of campaigns, the agi-VDAD_ALL_outbound.agi is invoked, so there i also have the campaign ID, so i should try and set the custom header for campaign ID, in here, and then when i sent it to my termination gateway i can read the campaign ID and bill the customer for the campaign usage.


Please correct me if i am wrong. Also please enclose the command for setting customer sip header using the SIPAddHeader command in an agi script. Thanks

best regards,
Zeeshan Sajid
zeeshansajid
 
Posts: 15
Joined: Wed Sep 28, 2011 3:18 pm

Postby williamconley » Mon Oct 31, 2011 10:51 am

since you already have the command, you should try using it in the dial plan in carriers instead of modifying your agi script. remember that when you upgrade vicidial ... that script may have changes requiring you to "repatch". Not to mention the possibility that you could mess up the programming of the agi while messing around in there.

but adding it to your dialplan instead could require a sep carrier for each campaign, but would be upgrade safe (and NOT require modification of any "code" on the server at all).

Merely adding an extra line to the dial plan which adds a sip header using standard asterisk dial plan language. No programming modifications. 8-)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby zeeshansajid » Tue Nov 01, 2011 5:42 pm

Hi William,

My scenario is that i am running a broadcast survey campaign, now my understanding is that the ast_managersend.pl script is creating the originate command as initiating the call, now i agree i should just be able to add a line to add a sip header in my carrier settings page.

Action: Originate
Exten: 8375
Context: default
Channel: Local/9XXXXXXXX10@default
Priority: 1
Callerid: "V4335465017611366" <MY NUMBER>
Timeout: 90000
VDACnote: TESTCAMPAIGN|17234366|1|404XXXX10|OUT|NONE|99

so i was wondering what VDACnote means, i know if i had

Variable: var1=23|var2=24|var3=25

in the above originate command, i would have just written the test campaign value into a channel variable and would just get it, so my question now is

Is there a way to get the TESTCAMPAIGN saved from VDACnote??

Please HELP
Thanks
best regards,
Zeeshan Sajid.
zeeshansajid
 
Posts: 15
Joined: Wed Sep 28, 2011 3:18 pm

Postby mflorell » Tue Nov 01, 2011 6:03 pm

Take a look at the agi-set_variables.agi script, it will let you set channel variables without messing with anything except for dialplan coding. We have used this in the past to do sip-header setting based upon lead/campaign data.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby zeeshansajid » Tue Nov 01, 2011 6:54 pm

thankx matt ... it worked like a charm :)

cheers
zeeshansajid
 
Posts: 15
Joined: Wed Sep 28, 2011 3:18 pm

Re:

Postby Op3r » Tue Jun 30, 2020 1:48 pm

mflorell wrote:Take a look at the agi-set_variables.agi script, it will let you set channel variables without messing with anything except for dialplan coding. We have used this in the past to do sip-header setting based upon lead/campaign data.


Matt,

Can you post an example on how to send data from lead data using agi-set_variables?

Do i need to add SIPheader on my dialplan or the agi will do it for me?
Get paid for US outbound Toll Free calls. PM me.
Op3r
 
Posts: 1424
Joined: Wed Jun 07, 2006 7:53 pm
Location: Manila

Re: add custom sip header before sending call to carrier

Postby mflorell » Tue Jun 30, 2020 5:57 pm

All the set variables AGI script does is set the variables, it does not touch SIP headers, so you'd have to do that in the dialplan after the AGI runs.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: add custom sip header before sending call to carrier

Postby Op3r » Tue Jul 07, 2020 3:46 pm

Hi Matt,

will this work?

exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
same => n,AGI(agi-set_variables.agi,)
same => n,SipAddHeader($first_name)
same => n,SipAddHeader($last_name)
same => n,SipAddHeader($address1)
same => n,SipAddHeader($city)
same => n,Dial(${TESTSIPTRUNK}/${EXTEN:2},,tTor) exten => _91NXXNXXXXXX,n,Hangup
Get paid for US outbound Toll Free calls. PM me.
Op3r
 
Posts: 1424
Joined: Wed Jun 07, 2006 7:53 pm
Location: Manila

Re: add custom sip header before sending call to carrier

Postby Op3r » Thu Jul 09, 2020 12:56 pm

yep it worked.
Get paid for US outbound Toll Free calls. PM me.
Op3r
 
Posts: 1424
Joined: Wed Jun 07, 2006 7:53 pm
Location: Manila

Re: add custom sip header before sending call to carrier

Postby carpenox » Fri Jul 10, 2020 8:13 pm

good shit...
Alma Linux 9.3 | Version: 2.14-911a | SVN Version: 3815 | DB Schema Version: 1710 | Asterisk 18.18.1
www.dialer.one -:- 1-833-DIALER-1 -:- https://linktr.ee/CyburDial -:- WhatsApp: +19549477572 -:- Skype: live:carpenox_3
carpenox
 
Posts: 2230
Joined: Wed Apr 08, 2020 2:02 am
Location: Coral Springs, FL


Return to Development

Who is online

Users browsing this forum: No registered users and 45 guests