[SIPForum-discussion] Bulk Call Generator

Shakil, Rashid rshakil at covad.com
Tue Aug 25 18:25:51 UTC 2009


Free : SIPP, WireShark

Paid : Empirix products

Probably more ...

From: discussion-bounces at sipforum.org [mailto:discussion-bounces at sipforum.org] On Behalf Of Manish Jain
Sent: Tuesday, August 25, 2009 7:07 AM
To: discussion at sipforum.org
Subject: [SIPForum-discussion] Bulk Call Generator

Dear All,

I am looking for a SIP based Bulk Call generator and Packet analyzer.

Can anybody help me out the name of free OR paid products with the vendor name?

Thanks
Manish Jain
On Mon, Aug 24, 2009 at 10:32 AM, Rachel Baskaran <rachelbaskaran at gmail.com<mailto:rachelbaskaran at gmail.com>> wrote:
Hey,

Now If I already have a ASTERISK at my workplace, how I need to connect to my other SIP acc or say my colleague?

Will the following script be enough to do the job?

#include<pjsua-lib/pjsua.h>

#define THIS_FILE       "APP"
#define SIP_DOMAIN   "test.com<http://test.com>" ( where my company domain fits here )
#define SIP_USER       "rachel"
#define SIP_PASSWD   "test"

//function call for incoming call with acc_id, call_id
static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, pjsip_rx_data *rdata)
{
pjsua_call_info ci;

PJ_UNUSED_ARG(acc_id);
PJ_UNUSED_ARG(rdata);

pjsua_call_get_info(call_id, &ci);

PJ_LOG(3,(THIS_FILE, "Incoming call from %.*s!!", (int)ci.remote_info.slen, ci.remote_info.ptr));

pjsua_call_answer(call_id, 200, NULL, NULL);
}


//main() where argv[] contains URI to call to
int main(int argc, char *argv[])
{
pjsua_acc_id acc_id;
pj_status_t status;


status = pjsua_create();
if(status != PJ_SUCESS)
error_exit("Error in pjsua_create()", status);


if(argc > 1) {
status = pjsua_verify_sip_url(argv[1]);
if(status != PJ_SUCESS)
error_exit("Invalid URL in argv", status);
}

//Variable dec for config files
pjsua_config cfg;
pjsua_logging_config log_cfg;

pjsua_config_default(&cfg);
cfg.cb.on_incoming_call = &on_incoming_call;

pjsua_logging_config_default(&log_cfg);
log_cfg.console_level = 4;


//Intilize pjsua
status = pjsua_init(&cfg, &log_cfg, NULL);
if(status != PJ_SUCESS)
error_exit("Error in pjsua_init()", status);
}

//transport through UDP
{
pjsua_transport_config cfg;


pjsua_transport_config_default(&cfg);
cfg.port = 5060;
 status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &cfg, NULL);
if(status != PJ_SUCESS)
error_exit("Error creating transport", status);
}

status = pjsua_start();
if(status != PJ_SUCESS)
error_exit("Error starting pjsua", status);
}

if(argc > 1){
pj_str_t uri = pj_str(argv[1]);
status = pjsua_call_make_call(acc_id, &uri, 0, NULL, NULL, NULL);
if(status != PJ_SUCESS)
error_exit("Error making call", status);
}

for(;;){
char option[10];

puts("Press 'h to hangup all calls, 'q'  to quit");
if(fgets(option, sizeof(option), stdin) == NULL){
puts("EOF while reading stdin, will quit now...");
break;
}

if (option[0] == 'q')
break;
if(option[0] == 'h')
pjsua_call_hangup_all();
}
pjsua_destroy();
return 0;
}


let's consider for example, that I'm gonna edit my sip.conf file as
[general]

[1000] (unique identifier)
type= friend ( includes both user and peer )
context = phones
host = dynamic ( client has a dynamic IP address )


Does the acc_id refers to my id( i.e rachel ) or my colleague's? What about the call_id?

If this script is right, where I need to store my script and run with GNU compiler?

Any help would be great!


Thanks
Rachel












_______________________________________________
This is the SIP Forum discussion mailing list
TO UNSUBSCRIBE, or edit your delivery options, please visit http://sipforum.org/mailman/listinfo/discussion
Post to the list at discussion at sipforum.org<mailto:discussion at sipforum.org>



--
With Regards,
Manish Jain

Luck Is Like a Blank Paper,where we writes our Future.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sipforum.org/pipermail/discussion/attachments/20090825/ebd258bf/attachment-0002.html>


More information about the discussion mailing list